Set authScheme

This commit is contained in:
Andrew Millington 2018-05-17 13:19:32 +01:00
parent 19d782d223
commit 3ea0cdc936

View File

@ -295,6 +295,8 @@ class OAuthServerException extends \Exception
// matching the authentication scheme used by the client. // matching the authentication scheme used by the client.
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
if ($this->errorType === 'invalid_client' && array_key_exists('HTTP_AUTHORIZATION', $_SERVER) !== false) { if ($this->errorType === 'invalid_client' && array_key_exists('HTTP_AUTHORIZATION', $_SERVER) !== false) {
$authScheme = strpos($_SERVER['HTTP_AUTHORIZATION'], 'Bearer') === 0 ? 'Bearer' : 'Basic';
$headers['WWW-Authenticate'] = $authScheme . ' realm="OAuth"'; $headers['WWW-Authenticate'] = $authScheme . ' realm="OAuth"';
} }
// @codeCoverageIgnoreEnd // @codeCoverageIgnoreEnd