File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 33namespace Laravel \Passport \Bridge ;
44
55use DateInterval ;
6+ use League \OAuth2 \Server \Exception \OAuthServerException ;
67use League \OAuth2 \Server \Grant \AbstractGrant ;
8+ use League \OAuth2 \Server \RequestEvent ;
79use League \OAuth2 \Server \ResponseTypes \ResponseTypeInterface ;
810use Psr \Http \Message \ServerRequestInterface ;
911
@@ -19,6 +21,13 @@ public function respondToAccessTokenRequest(
1921 ): ResponseTypeInterface {
2022 // Validate request
2123 $ client = $ this ->validateClient ($ request );
24+
25+ if (! $ client ->isConfidential ()) {
26+ $ this ->getEmitter ()->emit (new RequestEvent (RequestEvent::CLIENT_AUTHENTICATION_FAILED , $ request ));
27+
28+ throw OAuthServerException::invalidClient ($ request );
29+ }
30+
2231 $ scopes = $ this ->validateScopes ($ this ->getRequestParameter ('scope ' , $ request , $ this ->defaultScope ));
2332 $ userIdentifier = $ this ->getRequestParameter ('user_id ' , $ request );
2433
You can’t perform that action at this time.
0 commit comments