pub struct OidcFederationService<S> { /* private fields */ }Expand description
OIDC Federation service — sign in via Okta, Azure AD, Google Workspace, etc.
Implementations§
Source§impl<S> OidcFederationService<S>where
S: OidcFederationProviderRepository + UserRepository + SessionRepository + OAuthAccountRepository + OrgRepository + Clone + Send + Sync + 'static,
impl<S> OidcFederationService<S>where
S: OidcFederationProviderRepository + UserRepository + SessionRepository + OAuthAccountRepository + OrgRepository + Clone + Send + Sync + 'static,
pub fn new(storage: S, session_ttl_secs: i64, encryption_key: [u8; 32]) -> Self
Sourcepub async fn begin(
&self,
provider_name: &str,
redirect_uri: &str,
) -> Result<OidcFederationBeginResponse>
pub async fn begin( &self, provider_name: &str, redirect_uri: &str, ) -> Result<OidcFederationBeginResponse>
Begin OIDC federation flow. Returns URL to redirect user to the IdP.
Sourcepub async fn callback(
&self,
provider_name: &str,
code: &str,
state: &str,
ip: &str,
) -> Result<(User, Session, String)>
pub async fn callback( &self, provider_name: &str, code: &str, state: &str, ip: &str, ) -> Result<(User, Session, String)>
Handle callback from IdP. Exchange code, get userinfo, find-or-create user, create session. Looks up code_verifier and redirect_uri from the pending state stored during begin().
Auto Trait Implementations§
impl<S> Freeze for OidcFederationService<S>where
S: Freeze,
impl<S> !RefUnwindSafe for OidcFederationService<S>
impl<S> Send for OidcFederationService<S>where
S: Send,
impl<S> Sync for OidcFederationService<S>where
S: Sync,
impl<S> Unpin for OidcFederationService<S>where
S: Unpin,
impl<S> UnsafeUnpin for OidcFederationService<S>where
S: UnsafeUnpin,
impl<S> !UnwindSafe for OidcFederationService<S>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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