You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add token verification and post-issuance event handlers
- Implement event handler for token verification to validate tokens before processing requests
- Add post-issuance event that triggers after new tokens are generated
Copy file name to clipboardExpand all lines: src/Server/Handler.php
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,9 @@
6
6
7
7
useOAuth\Enum\ErrorCode;
8
8
useOAuth\Enum\TransportMethod;
9
+
useOAuth\Event\AfterCreateAccessTokenEvent;
9
10
useOAuth\Event\AfterGrantAccessEvent;
11
+
useOAuth\Event\VerifyTokenEvent;
10
12
useOAuth\Exception\OAuthAuthenticateException;
11
13
useOAuth\Exception\OAuthRedirectException;
12
14
useOAuth\Exception\OAuthServerException;
@@ -115,6 +117,8 @@ public function verifyAccessToken(string $tokenParam, ?string $scope = null): Ac
115
117
thrownewOAuthAuthenticateException(Response::HTTP_FORBIDDEN, $tokenType, $realm, ErrorCode::ERROR_INSUFFICIENT_SCOPE, 'The request requires higher privileges than provided by the access token.', $scope);
0 commit comments