File tree 2 files changed +5
-1
lines changed
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ pub struct JsonWebKey<'a> {
46
46
pub exponent : & ' a str ,
47
47
#[ serde( rename = "n" ) ]
48
48
pub modulus : & ' a str ,
49
+ #[ serde( default ) ]
49
50
pub issuer : & ' a str ,
50
51
}
51
52
Original file line number Diff line number Diff line change @@ -42,7 +42,10 @@ pub fn validate_token_rs256<CustomClaims: Serialize + DeserializeOwned>(
42
42
// Custom claims are also supported – see https://docs.rs/jwt-simple/0.9.3/jwt_simple/index.html#custom-claims
43
43
let verification_options = VerificationOptions {
44
44
allowed_issuers : Some ( HashSet :: from_strings ( & [
45
- key_metadata. issuer ,
45
+ // Some IdPs (e.g. Azure, when MS Live sign-in support is enabled) provide tenant-specific and public keys in the same JWKSet,
46
+ // and will therefore include the non-standard "issuer" property in JWK metadata.
47
+ // Uncomment the line below to include the issuer property from the key metadata during verification:
48
+ // key_metadata.issuer,
46
49
settings. openid_configuration . issuer ,
47
50
] ) ) ,
48
51
allowed_audiences : Some ( HashSet :: from_strings ( & [ settings. config . client_id ] ) ) ,
You can’t perform that action at this time.
0 commit comments