Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple client id sources #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,12 @@ public function handle(GetResponseEvent $event)
{
$request = $event->getRequest();

// At least one (and only one) of client credentials method required.
// At least one of client credentials method required.
// If more than one is set then basic auth will be used. Some clients (incorrectly) use more than one.
if (!$request->headers->get('PHP_AUTH_USER', false) && !$request->request->get('client_id', false)) {
throw new InvalidRequestException([
'error_description' => 'The request is missing a required parameter',
]);
} elseif ($request->headers->get('PHP_AUTH_USER', false) && $request->request->get('client_id', false)) {
throw new InvalidRequestException([
'error_description' => 'The request utilizes more than one mechanism for authenticating the client',
]);
}

// Check with HTTP basic auth if exists.
Expand Down