Skip to content

Commit f9d635c

Browse files
authored
Remove app id validation
1 parent 70bbafd commit f9d635c

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/Provider/Azure.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,7 @@ public function validateAccessToken($accessToken)
281281
* @return void
282282
*/
283283
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']) {
293285
throw new \RuntimeException('The client_id / audience is invalid!');
294286
}
295287
if ($tokenClaims['nbf'] > time() || $tokenClaims['exp'] < time()) {
@@ -301,6 +293,7 @@ public function validateTokenClaims($tokenClaims) {
301293
$this->tenant = $tokenClaims['tid'];
302294
}
303295

296+
$version = array_key_exists('ver', $tokenClaims) ? $tokenClaims['ver'] : $this->defaultEndPointVersion;
304297
$tenant = $this->getTenantDetails($this->tenant, $version);
305298
if ($tokenClaims['iss'] != $tenant['issuer']) {
306299
throw new \RuntimeException('Invalid token issuer (tokenClaims[iss]' . $tokenClaims['iss'] . ', tenant[issuer] ' . $tenant['issuer'] . ')!');

0 commit comments

Comments
 (0)