From dba5f6896d06c9ee018296ca078bd8411c7da6d9 Mon Sep 17 00:00:00 2001 From: "Kowalski Dragon (kowalski7cc)" Date: Wed, 7 Oct 2026 14:38:57 +0200 Subject: [PATCH] Refactor SSO ACR to use add_auth_context_value AuthenticationContextClass Signed-off-by: Kowalski Dragon (kowalski7cc) --- src/sso_client.rs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/sso_client.rs b/src/sso_client.rs index 9fa19664..f0ce37c3 100644 --- a/src/sso_client.rs +++ b/src/sso_client.rs @@ -1,8 +1,9 @@ use std::{borrow::Cow, collections::HashSet, future::Future, pin::Pin, sync::LazyLock, time::Duration}; use openidconnect::{ - AccessToken, AsyncHttpClient, AuthDisplay, AuthPrompt, AuthType, AuthenticationFlow, AuthorizationCode, - AuthorizationRequest, ClientId, ClientSecret, CsrfToken, EmptyAdditionalClaims, EmptyExtraTokenFields, + AccessToken, AsyncHttpClient, AuthDisplay, AuthPrompt, AuthType, AuthenticationContextClass, AuthenticationFlow, + AuthorizationCode, AuthorizationRequest, ClientId, ClientSecret, CsrfToken, EmptyAdditionalClaims, + EmptyExtraTokenFields, EndpointNotSet, EndpointSet, HttpClientError, HttpRequest, HttpResponse, IdTokenClaims, IdTokenFields, Nonce, OAuth2TokenResponse, PkceCodeChallenge, PkceCodeVerifier, RefreshToken, ResponseType, Scope, StandardErrorResponse, StandardTokenResponse, @@ -203,18 +204,7 @@ impl Client { .add_extra_params(CONFIG.sso_authorize_extra_params_vec()); if CONFIG.sso_2fa_skip() == "auto" { - auth_req = auth_req.add_extra_param( - "claims", - serde_json::json!({ - "id_token": { - "acr": { - "essential": true, - "values": [crate::sso::SSO_2FA_ACR] - } - } - }) - .to_string(), - ); + auth_req = auth_req.add_auth_context_value(AuthenticationContextClass::new(crate::sso::SSO_2FA_ACR.to_owned())); } if CONFIG.sso_pkce() {