pub struct OidcClient<PS>where
PS: PendingOauthStore,{ /* private fields */ }Expand description
Wraps the OIDC discovered client for login/callback flows.
The redirect URI is resolved dynamically per-request so that
external_base_url = "auto" can produce the correct absolute callback URL
based on the incoming request headers.
Implementations§
Source§impl<PS> OidcClient<PS>where
PS: PendingOauthStore,
impl<PS> OidcClient<PS>where
PS: PendingOauthStore,
pub async fn from_config( config: OidcClientConfig<PS::Config>, ) -> OidcResult<Self>
pub async fn from_provider( provider: Arc<OAuthProviderRuntime>, config: OidcClientConfig<PS::Config>, ) -> OidcResult<Self>
pub fn provider(&self) -> &Arc<OAuthProviderRuntime>
pub async fn handle_device_token_poll( &self, device_authorization: &OidcDeviceAuthorizationResult, current_interval: Option<Duration>, ) -> OidcResult<OidcDeviceTokenPollResult>
pub async fn handle_device_token_poll_until_complete( &self, device_authorization: &OidcDeviceAuthorizationResult, timeout: Option<Duration>, ) -> OidcResult<OidcDeviceTokenResult>
pub async fn handle_code_callback( &self, search_params: OidcCodeCallbackSearchParams, external_base_url: &Url, ) -> OidcResult<OidcCodeCallbackResult>
pub async fn handle_code_callback_with_redirect_override( &self, search_params: OidcCodeCallbackSearchParams, external_base_url: &Url, redirect_url_override: Option<&str>, ) -> OidcResult<OidcCodeCallbackResult>
pub async fn handle_code_callback_with_redirect_override_diagnosed( &self, search_params: OidcCodeCallbackSearchParams, external_base_url: &Url, redirect_url_override: Option<&str>, ) -> DiagnosedResult<OidcCodeCallbackResult, OidcError>
pub async fn handle_token_refresh( &self, refresh_token: String, id_token: Option<String>, ) -> OidcResult<OidcRefreshTokenResult>
pub async fn handle_token_refresh_diagnosed( &self, refresh_token: String, id_token: Option<String>, ) -> DiagnosedResult<OidcRefreshTokenResult, OidcError>
pub async fn handle_token_revoke( &self, token: OidcRevocableToken, ) -> OidcResult<()>
Sourcepub async fn handle_user_info_exchange(
&self,
id_token_raw: &str,
access_token: &str,
) -> OidcResult<UserInfoExchangeResult>
pub async fn handle_user_info_exchange( &self, id_token_raw: &str, access_token: &str, ) -> OidcResult<UserInfoExchangeResult>
Shared user_info exchange helper for backend modes.
Given a raw id_token string and a bearer access_token, this method:
- Decodes and verifies the ID token (nonce validation is skipped, since this is a server-side post-flow call, not an in-flight callback).
- Optionally calls the provider’s userinfo endpoint (if available).
- Runs
check_claimsto produce aClaimsCheckResult.
Backend OIDC presets (pure, mediated, etc.) should call this helper rather than reimplementing the user-info protocol stack.
pub async fn exchange_code( &self, external_base_url: &Url, code: &str, nonce: &Nonce, pkce_verifier_secret: Option<&str>, ) -> OidcResult<OidcCodeExchangeResult>
pub async fn exchange_code_with_redirect_override( &self, external_base_url: &Url, code: &str, nonce: &Nonce, pkce_verifier_secret: Option<&str>, redirect_url_override: Option<&str>, ) -> OidcResult<OidcCodeExchangeResult>
Auto Trait Implementations§
impl<PS> Freeze for OidcClient<PS>
impl<PS> !RefUnwindSafe for OidcClient<PS>
impl<PS> Send for OidcClient<PS>
impl<PS> Sync for OidcClient<PS>
impl<PS> Unpin for OidcClient<PS>
impl<PS> UnsafeUnpin for OidcClient<PS>
impl<PS> !UnwindSafe for OidcClient<PS>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more