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 3
3
namespace Laravel \Passport \Bridge ;
4
4
5
5
use DateInterval ;
6
+ use League \OAuth2 \Server \Exception \OAuthServerException ;
6
7
use League \OAuth2 \Server \Grant \AbstractGrant ;
8
+ use League \OAuth2 \Server \RequestEvent ;
7
9
use League \OAuth2 \Server \ResponseTypes \ResponseTypeInterface ;
8
10
use Psr \Http \Message \ServerRequestInterface ;
9
11
@@ -19,6 +21,13 @@ public function respondToAccessTokenRequest(
19
21
): ResponseTypeInterface {
20
22
// Validate request
21
23
$ 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
+
22
31
$ scopes = $ this ->validateScopes ($ this ->getRequestParameter ('scope ' , $ request , $ this ->defaultScope ));
23
32
$ userIdentifier = $ this ->getRequestParameter ('user_id ' , $ request );
24
33
You can’t perform that action at this time.
0 commit comments