1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-07 17:03:01 +03:00

Add equality claim validator

This commit is contained in:
Kévin Commaille
2022-11-28 11:39:38 +01:00
committed by Quentin Gliech
parent db25574a96
commit a2a3b3954e
7 changed files with 82 additions and 33 deletions

View File

@@ -22,7 +22,7 @@ use chrono::Duration;
use mas_iana::oauth::{
OAuthAccessTokenType, OAuthClientAuthenticationMethod, PkceCodeChallengeMethod,
};
use mas_jose::jwk::PublicJsonWebKeySet;
use mas_jose::{claims::ClaimError, jwk::PublicJsonWebKeySet};
use mas_oidc_client::{
error::{
AuthorizationError, IdTokenError, PushedAuthorizationError, TokenAuthorizationCodeError,
@@ -358,7 +358,13 @@ async fn fail_access_token_with_authorization_code_wrong_nonce() {
.await
.unwrap_err();
assert_matches!(error, TokenAuthorizationCodeError::WrongNonce);
assert_matches!(
error,
TokenAuthorizationCodeError::IdToken(IdTokenError::Claim(ClaimError::ValidationError {
claim: "nonce",
..
}))
);
}
#[tokio::test]