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

WIP: upstream OIDC provider support

This commit is contained in:
Quentin Gliech
2022-11-22 18:28:16 +01:00
parent 7f9be07e8d
commit bedcf44741
28 changed files with 1505 additions and 96 deletions

View File

@ -23,6 +23,7 @@ use http::Request;
use mas_iana::{jose::JsonWebSignatureAlg, oauth::OAuthClientAuthenticationMethod};
use mas_jose::{
claims::{self, ClaimError},
constraints::Constrainable,
jwa::SymmetricKey,
jwt::{JsonWebSignatureHeader, Jwt},
};
@ -338,7 +339,12 @@ impl RequestClientCredentials {
.signing_key_for_algorithm(&signing_algorithm)
.ok_or(CredentialsError::NoPrivateKeyFound)?;
let signer = key.params().signing_key_for_alg(&signing_algorithm)?;
let header = JsonWebSignatureHeader::new(signing_algorithm);
let mut header = JsonWebSignatureHeader::new(signing_algorithm);
if let Some(kid) = key.kid() {
header = header.with_kid(kid);
}
Jwt::sign(header, claims, &signer)?.to_string()
}
JwtSigningMethod::Custom(jwt_signing_fn) => {