-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Labels
5.0The issues we want to solve in the 5.0 releaseThe issues we want to solve in the 5.0 releasebugA bug reportA bug reportstatus: mediumMediumMedium
Description
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)) {
throw new \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
Metadata
Metadata
Assignees
Labels
5.0The issues we want to solve in the 5.0 releaseThe issues we want to solve in the 5.0 releasebugA bug reportA bug reportstatus: mediumMediumMedium
Type
Projects
Status
Released