pub struct OAuth2Authenticator { /* private fields */ }Expand description
OAuth2 authenticator that validates OAuth2 access tokens
This authenticator checks for Bearer tokens in the Authorization header and validates them against the OAuth2 provider.
Implementations§
Source§impl OAuth2Authenticator
impl OAuth2Authenticator
Sourcepub fn new() -> OAuth2Authenticator
pub fn new() -> OAuth2Authenticator
Create a new OAuth2 authenticator
Sourcepub fn issuer(self, issuer: impl Into<String>) -> OAuth2Authenticator
pub fn issuer(self, issuer: impl Into<String>) -> OAuth2Authenticator
Set the expected issuer
Sourcepub fn jwks_uri(self, uri: impl Into<String>) -> OAuth2Authenticator
pub fn jwks_uri(self, uri: impl Into<String>) -> OAuth2Authenticator
Set the JWKS URI for token validation
Sourcepub fn username_attribute(self, attr: impl Into<String>) -> OAuth2Authenticator
pub fn username_attribute(self, attr: impl Into<String>) -> OAuth2Authenticator
Set the attribute to use as username
Trait Implementations§
Source§impl Authenticator for OAuth2Authenticator
impl Authenticator for OAuth2Authenticator
Source§impl Clone for OAuth2Authenticator
impl Clone for OAuth2Authenticator
Source§fn clone(&self) -> OAuth2Authenticator
fn clone(&self) -> OAuth2Authenticator
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 Default for OAuth2Authenticator
impl Default for OAuth2Authenticator
Source§fn default() -> OAuth2Authenticator
fn default() -> OAuth2Authenticator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OAuth2Authenticator
impl RefUnwindSafe for OAuth2Authenticator
impl Send for OAuth2Authenticator
impl Sync for OAuth2Authenticator
impl Unpin for OAuth2Authenticator
impl UnwindSafe for OAuth2Authenticator
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 more