File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -281,15 +281,7 @@ public function validateAccessToken($accessToken)
281
281
* @return void
282
282
*/
283
283
public function validateTokenClaims ($ tokenClaims ) {
284
- $ version = array_key_exists ('ver ' , $ tokenClaims ) ? $ tokenClaims ['ver ' ] : $ this ->defaultEndPointVersion ;
285
-
286
- if ($ version == self ::ENDPOINT_VERSION_1_0 ) {
287
- $ appId = $ tokenClaims ['appid ' ];
288
- } else {
289
- $ appId = $ tokenClaims ['azp ' ];
290
- }
291
-
292
- if ($ this ->getClientId () != $ tokenClaims ['aud ' ] && $ this ->getClientId () != $ appId ) {
284
+ if ($ this ->getClientId () != $ tokenClaims ['aud ' ]) {
293
285
throw new \RuntimeException ('The client_id / audience is invalid! ' );
294
286
}
295
287
if ($ tokenClaims ['nbf ' ] > time () || $ tokenClaims ['exp ' ] < time ()) {
@@ -301,6 +293,7 @@ public function validateTokenClaims($tokenClaims) {
301
293
$ this ->tenant = $ tokenClaims ['tid ' ];
302
294
}
303
295
296
+ $ version = array_key_exists ('ver ' , $ tokenClaims ) ? $ tokenClaims ['ver ' ] : $ this ->defaultEndPointVersion ;
304
297
$ tenant = $ this ->getTenantDetails ($ this ->tenant , $ version );
305
298
if ($ tokenClaims ['iss ' ] != $ tenant ['issuer ' ]) {
306
299
throw new \RuntimeException ('Invalid token issuer (tokenClaims[iss] ' . $ tokenClaims ['iss ' ] . ', tenant[issuer] ' . $ tenant ['issuer ' ] . ')! ' );
You can’t perform that action at this time.
0 commit comments