You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-29 22:01:14 +03:00
Add OneOrMany contains claim validator
This commit is contained in:
committed by
Quentin Gliech
parent
a2a3b3954e
commit
f71f68c926
@ -154,7 +154,10 @@ async fn fail_verify_id_token_wrong_audience() {
|
||||
|
||||
assert_matches!(
|
||||
error,
|
||||
IdTokenError::Jwt(JwtVerificationError::WrongAudience)
|
||||
IdTokenError::Jwt(JwtVerificationError::Claim(ClaimError::ValidationError {
|
||||
claim: "aud",
|
||||
..
|
||||
}))
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -474,10 +474,7 @@ fn verify_client_jwt(
|
||||
return Err("Wrong sub".into());
|
||||
}
|
||||
|
||||
let aud = claims::AUD.extract_required(claims)?;
|
||||
if !aud.contains(token_endpoint) {
|
||||
return Err("Wrong aud".into());
|
||||
}
|
||||
claims::AUD.extract_required_with_options(claims, token_endpoint)?;
|
||||
|
||||
claims::EXP.extract_required_with_options(claims, TimeOptions::new(now()))?;
|
||||
|
||||
|
Reference in New Issue
Block a user