pub struct CustomOidcSocialProvider { /* private fields */ }Expand description
Generic OIDC-compliant social provider.
Supports any IdP that publishes an OIDC discovery document or accepts
explicit authorize_url / token_url / userinfo_url configuration.
Exactly one of discovery / pinned_endpoints is Some after
construction; the other is always None.
Implementations§
Source§impl CustomOidcSocialProvider
impl CustomOidcSocialProvider
Sourcepub async fn new(config: SocialProviderConfig) -> Result<Self, AuthError>
pub async fn new(config: SocialProviderConfig) -> Result<Self, AuthError>
Build a CustomOidcSocialProvider from a decrypted config.
For the discovery_url path this performs one HTTP round-trip to
fetch the discovery document. The HTTP client is built with a
15-second timeout and a User-Agent: allowthem-oauth header.
Returns AuthError::Validation for config problems;
AuthError::OAuthHttp for discovery-fetch failures.
Trait Implementations§
Source§impl Debug for CustomOidcSocialProvider
impl Debug for CustomOidcSocialProvider
Source§impl SocialProvider for CustomOidcSocialProvider
impl SocialProvider for CustomOidcSocialProvider
Build the OIDC authorization redirect URL.
Reads from the cached discovery doc (sync read-lock). The cache is
always populated by new(), so the doc may be stale if the IdP
rotated endpoints after the last refresh, but endpoint rotation within
a single TTL window is an IdP misconfiguration, not a normal event.
Source§fn provider_type(&self) -> ProviderType
fn provider_type(&self) -> ProviderType
Source§fn exchange_code<'a>(
&'a self,
code: &'a str,
redirect_uri: &'a str,
pkce_verifier: &'a str,
) -> AuthFuture<'a, String>
fn exchange_code<'a>( &'a self, code: &'a str, redirect_uri: &'a str, pkce_verifier: &'a str, ) -> AuthFuture<'a, String>
Source§fn fetch_user_info<'a>(
&'a self,
access_token: &'a str,
) -> AuthFuture<'a, SocialUserInfo>
fn fetch_user_info<'a>( &'a self, access_token: &'a str, ) -> AuthFuture<'a, SocialUserInfo>
Auto Trait Implementations§
impl !Freeze for CustomOidcSocialProvider
impl !RefUnwindSafe for CustomOidcSocialProvider
impl Send for CustomOidcSocialProvider
impl Sync for CustomOidcSocialProvider
impl Unpin for CustomOidcSocialProvider
impl UnsafeUnpin for CustomOidcSocialProvider
impl !UnwindSafe for CustomOidcSocialProvider
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
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>
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>
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