pub enum OAuth2Context {
NotInitialized,
NotAuthenticated {
reason: Reason,
},
Authenticated(Authentication),
Failed(String),
}Expand description
The authentication context
Variants§
NotInitialized
The agent is not initialized yet.
NotAuthenticated
Not authenticated.
Authenticated(Authentication)
Session is authenticated.
Failed(String)
Something failed.
Implementations§
Source§impl OAuth2Context
impl OAuth2Context
Sourcepub fn authentication(&self) -> Option<&Authentication>
pub fn authentication(&self) -> Option<&Authentication>
Get the optional authentication.
Allows easy access to the authentication information. Will return None if the
context is not authenticated.
Sourcepub fn access_token(&self) -> Option<&str>
pub fn access_token(&self) -> Option<&str>
Get the access token, if the context is OAuth2Context::Authenticated
Sourcepub fn id_token(&self) -> Option<&str>
pub fn id_token(&self) -> Option<&str>
Get the id token, if the context is OAuth2Context::Authenticated
Sourcepub fn claims(&self) -> Option<&Claims>
Available on crate feature openid only.
pub fn claims(&self) -> Option<&Claims>
openid only.Get the claims, if the context is OAuth2Context::Authenticated
Trait Implementations§
Source§impl Clone for OAuth2Context
impl Clone for OAuth2Context
Source§fn clone(&self) -> OAuth2Context
fn clone(&self) -> OAuth2Context
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OAuth2Context
impl Debug for OAuth2Context
Source§impl From<OAuth2Error> for OAuth2Context
impl From<OAuth2Error> for OAuth2Context
Source§fn from(err: OAuth2Error) -> Self
fn from(err: OAuth2Error) -> Self
Converts to this type from the input type.
Source§impl PartialEq for OAuth2Context
impl PartialEq for OAuth2Context
impl StructuralPartialEq for OAuth2Context
Auto Trait Implementations§
impl Freeze for OAuth2Context
impl RefUnwindSafe for OAuth2Context
impl !Send for OAuth2Context
impl !Sync for OAuth2Context
impl Unpin for OAuth2Context
impl UnwindSafe for OAuth2Context
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.