You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-28 11:02:02 +03:00
Add OneOrMany contains claim validator
This commit is contained in:
committed by
Quentin Gliech
parent
a2a3b3954e
commit
f71f68c926
@ -602,10 +602,6 @@ pub enum JwtVerificationError {
|
||||
#[error(transparent)]
|
||||
Claim(#[from] ClaimError),
|
||||
|
||||
/// The audience of the JWT is not this client.
|
||||
#[error("wrong aud claim")]
|
||||
WrongAudience,
|
||||
|
||||
/// The algorithm used for signing the JWT is not the one that was
|
||||
/// requested.
|
||||
#[error("wrong signature alg")]
|
||||
|
@ -130,10 +130,7 @@ pub fn verify_signed_jwt<'a>(
|
||||
claims::ISS.extract_required_with_options(&mut claims, issuer.as_str())?;
|
||||
|
||||
// Must have the proper audience.
|
||||
let aud = claims::AUD.extract_required(&mut claims)?;
|
||||
if !aud.contains(client_id) {
|
||||
return Err(JwtVerificationError::WrongAudience);
|
||||
}
|
||||
claims::AUD.extract_required_with_options(&mut claims, client_id)?;
|
||||
|
||||
// Must use the proper algorithm.
|
||||
if header.alg() != signing_algorithm {
|
||||
|
Reference in New Issue
Block a user