You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Basic auth with only username suddenly no longer working.
To Reproduce
Use Postman or similar to call an endpoint with Basic Auth containing just username ("api key")
Inside endpoint, call getBasicAuth and notice without the "password" it will return null instead of returning username and null as password
Provide minimal script to reproduce the issue
$apiKey = isset($this->request->getBasicAuth()['username']) ? $this->request->getBasicAuth()['username'] : '' ;
if (empty($apiKey)) {
thrownew \Exception('Api key is required');
}
Expected behavior
Continue to pass along the username
Screenshots
If applicable, add screenshots to help explain your problem.
Details
Phalcon version: 5.8.0
PHP Version: 8.2.26
Operating System: Alpine
Installation type: pecl install phalcon
Zephir version (if any):
Server: Nginx
Other related info (Database, table schema): Mysql
Additional context
getBasicAuth been in the code for very long time; something recently change on Nov 19 2024 onward that doesn't match phalcon ChangeLog (maybe outside of Phalcon). The fix was to use getServer('PHP_AUTH_USER') instead of calling getBasicAuth
The text was updated successfully, but these errors were encountered:
I had some spare time to check this out, unfortunately I can not replicate this issue. Here's a screenshot of postman running the same exact minimal reproduction code provided
The fix you've mentioned doesn't exactly say much since under the hood, the same this->getServerArray() method is being used on both hasServer() and getServer() methods.
I will require more info on your setup. What version of nginx do you use? do you use it as a proxy to a backend web server or passing to php-fpm?
Describe the bug
Basic auth with only username suddenly no longer working.
To Reproduce
Expected behavior
Continue to pass along the username
Screenshots
If applicable, add screenshots to help explain your problem.
Details
Additional context
getBasicAuth been in the code for very long time; something recently change on Nov 19 2024 onward that doesn't match phalcon ChangeLog (maybe outside of Phalcon). The fix was to use getServer('PHP_AUTH_USER') instead of calling getBasicAuth
The text was updated successfully, but these errors were encountered: