mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-16 10:18:55 +05:30
Authorization header fixes
This commit is contained in:
parent
55d68bd105
commit
89f3c35466
@ -161,7 +161,7 @@ class ResourceServer
|
|||||||
protected function determineAccessToken()
|
protected function determineAccessToken()
|
||||||
{
|
{
|
||||||
if ($header = $this->getRequest()->header('Authorization')) {
|
if ($header = $this->getRequest()->header('Authorization')) {
|
||||||
$access_token = trim(str_replace('Bearer', '', $header));
|
$access_token = base64_decode(trim(str_replace('Bearer', '', $header)));
|
||||||
} else {
|
} else {
|
||||||
$method = $this->getRequest()->server('REQUEST_METHOD');
|
$method = $this->getRequest()->server('REQUEST_METHOD');
|
||||||
$access_token = $this->getRequest()->{$method}($this->tokenKey);
|
$access_token = $this->getRequest()->{$method}($this->tokenKey);
|
||||||
|
@ -65,6 +65,9 @@ class Request implements RequestInterface
|
|||||||
|
|
||||||
protected function readHeaders()
|
protected function readHeaders()
|
||||||
{
|
{
|
||||||
|
if (function_exists('getallheaders')) {
|
||||||
|
$headers = getallheaders();
|
||||||
|
} else {
|
||||||
$headers = array();
|
$headers = array();
|
||||||
foreach ($this->server() as $name => $value) {
|
foreach ($this->server() as $name => $value) {
|
||||||
if (substr($name, 0, 5) == 'HTTP_') {
|
if (substr($name, 0, 5) == 'HTTP_') {
|
||||||
@ -72,6 +75,7 @@ class Request implements RequestInterface
|
|||||||
$headers[$name] = $value;
|
$headers[$name] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $headers;
|
return $headers;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user