Skip to content

Commit

Permalink
Add config option for default algorithm JWK (#908)
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Esser <[email protected]>
  • Loading branch information
esseremmerik and Peter Esser authored Sep 17, 2022
1 parent c9ac6c8 commit d63542b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ private function validateIdToken($idToken)
}

// signature validation and return claims
return (array) JWT::decode($idToken, JWK::parseKeySet($this->getJWTKeys()), $this->getOpenIdConfiguration()->id_token_signing_alg_values_supported);
return (array) JWT::decode($idToken, JWK::parseKeySet($this->getJWTKeys(), $this->getConfig('default_algorithm')), $this->getOpenIdConfiguration()->id_token_signing_alg_values_supported);
} catch (Exception $ex) {
throw new InvalidStateException("Error on validationg id_token. {$ex}");
}
Expand Down Expand Up @@ -223,6 +223,7 @@ public static function additionalConfigKeys()
'domain',
'policy',
'redirect_template',
'default_algorithm',
];
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Please see the [Base Installation Guide](https://socialiteproviders.com/usage/),
'redirect' => env('AADB2C_RedirectUri'),
'domain' => env('AADB2C_Domain'), // {your_domain}.b2clogin.com
'policy' => env('AADB2C_Policy'), // such as 'b2c_1_user_susi'
'default_algorithm' => env('AADB2C_DefaultAlgorithm'), // optional, decoding algorithm JWK key such as 'RS256'
],
```

Expand Down

0 comments on commit d63542b

Please sign in to comment.