From 787b0c8dde8f12c9d2e2b2fe2eaaccc41b7b6984 Mon Sep 17 00:00:00 2001 From: Michael Michel Date: Fri, 24 May 2024 14:39:22 +0200 Subject: [PATCH] add auth context value with static value of 2 --- src/middleware.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/middleware.rs b/src/middleware.rs index 97bbc09..3050e3f 100644 --- a/src/middleware.rs +++ b/src/middleware.rs @@ -15,12 +15,7 @@ use tower_service::Service; use tower_sessions::Session; use openidconnect::{ - core::{CoreAuthenticationFlow, CoreErrorResponseType, CoreGenderClaim}, - reqwest::async_http_client, - AccessToken, AccessTokenHash, AuthorizationCode, CsrfToken, IdTokenClaims, Nonce, - OAuth2TokenResponse, PkceCodeChallenge, PkceCodeVerifier, RedirectUrl, RefreshToken, - RequestTokenError::ServerResponse, - Scope, TokenResponse, + core::{CoreAuthenticationFlow, CoreErrorResponseType, CoreGenderClaim}, reqwest::async_http_client, AccessToken, AccessTokenHash, AuthenticationContextClass, AuthorizationCode, CsrfToken, IdTokenClaims, Nonce, OAuth2TokenResponse, PkceCodeChallenge, PkceCodeVerifier, RedirectUrl, RefreshToken, RequestTokenError::ServerResponse, Scope, TokenResponse }; use crate::{ @@ -188,6 +183,8 @@ where auth = auth.add_scope(Scope::new(scope.to_string())); } + auth = auth.add_auth_context_value(AuthenticationContextClass::new(String::from("2"))); + auth.set_pkce_challenge(pkce_challenge).url() };