pub struct OidcProvider<S: AuthStorage + ?Sized> { /* private fields */ }
Expand description
OpenID Connect Provider
Implementations§
Source§impl<S: ?Sized + AuthStorage> OidcProvider<S>
impl<S: ?Sized + AuthStorage> OidcProvider<S>
Sourcepub async fn new(
config: OidcConfig,
token_manager: Arc<TokenManager>,
storage: Arc<S>,
) -> Result<Self>
pub async fn new( config: OidcConfig, token_manager: Arc<TokenManager>, storage: Arc<S>, ) -> Result<Self>
Create a new OIDC Provider
Sourcepub fn oauth2_server(&self) -> &OAuth2Server
pub fn oauth2_server(&self) -> &OAuth2Server
Get the underlying OAuth 2.0 server
Sourcepub fn set_client_registry(&mut self, client_registry: Arc<ClientRegistry>)
pub fn set_client_registry(&mut self, client_registry: Arc<ClientRegistry>)
Set the client registry for validation
Sourcepub fn config(&self) -> &OidcConfig
pub fn config(&self) -> &OidcConfig
Get OIDC configuration
Sourcepub fn discovery_document(&self) -> Result<OidcDiscoveryDocument>
pub fn discovery_document(&self) -> Result<OidcDiscoveryDocument>
Generate OpenID Connect Discovery document
Sourcepub async fn create_id_token(
&self,
subject: &str,
client_id: &str,
nonce: Option<&str>,
auth_time: Option<SystemTime>,
claims: Option<&HashMap<String, Value>>,
) -> Result<String>
pub async fn create_id_token( &self, subject: &str, client_id: &str, nonce: Option<&str>, auth_time: Option<SystemTime>, claims: Option<&HashMap<String, Value>>, ) -> Result<String>
Create an ID token
Validate an authorization request for OIDC
Sourcepub async fn get_userinfo(&self, access_token: &str) -> Result<UserInfo>
pub async fn get_userinfo(&self, access_token: &str) -> Result<UserInfo>
Get user information for the UserInfo endpoint
Sourcepub async fn handle_logout(
&self,
id_token_hint: Option<&str>,
post_logout_redirect_uri: Option<&str>,
state: Option<&str>,
) -> Result<LogoutResponse>
pub async fn handle_logout( &self, id_token_hint: Option<&str>, post_logout_redirect_uri: Option<&str>, state: Option<&str>, ) -> Result<LogoutResponse>
Handle logout request
Sourcepub fn generate_jwks(&self) -> Result<JwkSet>
pub fn generate_jwks(&self) -> Result<JwkSet>
Generate JWK Set for the .well-known/jwks.json endpoint
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for OidcProvider<S>where
S: ?Sized,
impl<S> !RefUnwindSafe for OidcProvider<S>
impl<S> Send for OidcProvider<S>where
S: ?Sized,
impl<S> Sync for OidcProvider<S>where
S: ?Sized,
impl<S> Unpin for OidcProvider<S>where
S: ?Sized,
impl<S> !UnwindSafe for OidcProvider<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
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