Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Provider/Azure.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,13 @@ public function validateAccessToken($accessToken)
* @return void
*/
public function validateTokenClaims($tokenClaims) {
$timestamp = \is_null(JWT::$timestamp) ? \time() : JWT::$timestamp;

if ($this->getClientId() != $tokenClaims['aud']) {
throw new \RuntimeException('The client_id / audience is invalid!');
}
if ($tokenClaims['nbf'] > time() || $tokenClaims['exp'] < time()) {

if ($tokenClaims['nbf'] > ($timestamp + JWT::$leeway) || $tokenClaims['exp'] < ($timestamp - JWT::$leeway)) {
// Additional validation is being performed in firebase/JWT itself
throw new \RuntimeException('The id_token is invalid!');
}
Expand Down