Browse Source

Refactor SSO ACR to use add_auth_context_value AuthenticationContextClass

Signed-off-by: Kowalski Dragon (kowalski7cc) <kowalski7cc@users.noreply.github.com>
pull/7749/head
Kowalski Dragon (kowalski7cc) 2 weeks ago
parent
commit
dba5f6896d
No known key found for this signature in database GPG Key ID: C4E819BD2BC6233E
  1. 18
      src/sso_client.rs

18
src/sso_client.rs

@ -1,8 +1,9 @@
use std::{borrow::Cow, collections::HashSet, future::Future, pin::Pin, sync::LazyLock, time::Duration}; use std::{borrow::Cow, collections::HashSet, future::Future, pin::Pin, sync::LazyLock, time::Duration};
use openidconnect::{ use openidconnect::{
AccessToken, AsyncHttpClient, AuthDisplay, AuthPrompt, AuthType, AuthenticationFlow, AuthorizationCode, AccessToken, AsyncHttpClient, AuthDisplay, AuthPrompt, AuthType, AuthenticationContextClass, AuthenticationFlow,
AuthorizationRequest, ClientId, ClientSecret, CsrfToken, EmptyAdditionalClaims, EmptyExtraTokenFields, AuthorizationCode, AuthorizationRequest, ClientId, ClientSecret, CsrfToken, EmptyAdditionalClaims,
EmptyExtraTokenFields,
EndpointNotSet, EndpointSet, HttpClientError, HttpRequest, HttpResponse, IdTokenClaims, IdTokenFields, Nonce, EndpointNotSet, EndpointSet, HttpClientError, HttpRequest, HttpResponse, IdTokenClaims, IdTokenFields, Nonce,
OAuth2TokenResponse, PkceCodeChallenge, PkceCodeVerifier, RefreshToken, ResponseType, Scope, StandardErrorResponse, OAuth2TokenResponse, PkceCodeChallenge, PkceCodeVerifier, RefreshToken, ResponseType, Scope, StandardErrorResponse,
StandardTokenResponse, StandardTokenResponse,
@ -203,18 +204,7 @@ impl Client {
.add_extra_params(CONFIG.sso_authorize_extra_params_vec()); .add_extra_params(CONFIG.sso_authorize_extra_params_vec());
if CONFIG.sso_2fa_skip() == "auto" { if CONFIG.sso_2fa_skip() == "auto" {
auth_req = auth_req.add_extra_param( auth_req = auth_req.add_auth_context_value(AuthenticationContextClass::new(crate::sso::SSO_2FA_ACR.to_owned()));
"claims",
serde_json::json!({
"id_token": {
"acr": {
"essential": true,
"values": [crate::sso::SSO_2FA_ACR]
}
}
})
.to_string(),
);
} }
if CONFIG.sso_pkce() { if CONFIG.sso_pkce() {

Loading…
Cancel
Save