pub struct Authenticator { /* private fields */ }Expand description
Simple OIDC authenticator.
Implementations§
Source§impl Authenticator
impl Authenticator
Sourcepub fn new(config: AuthenticatorConfig) -> Authenticator
pub fn new(config: AuthenticatorConfig) -> Authenticator
Sourcepub async fn get_token_with_expiry(
&self,
client: &ClientWithMiddleware,
) -> Result<AuthenticatorResult, AuthenticatorError>
pub async fn get_token_with_expiry( &self, client: &ClientWithMiddleware, ) -> Result<AuthenticatorResult, AuthenticatorError>
Get a token. This will only fetch a new token if it is about to expire (will expire in the next 60 seconds). This also returns when the next token will be requested. This is the time when the authenticator will refresh the token, so the actual expiry time minus 60 seconds.
§Arguments
client- Reqwest client to use for requests to the IdP.
Sourcepub async fn get_token(
&self,
client: &ClientWithMiddleware,
) -> Result<String, AuthenticatorError>
pub async fn get_token( &self, client: &ClientWithMiddleware, ) -> Result<String, AuthenticatorError>
Get a token. This will only fetch a new token if it is about to expire (will expire in the next 60 seconds).
§Arguments
client- Reqwest client to use for requests to the IdP.
Auto Trait Implementations§
impl Freeze for Authenticator
impl !RefUnwindSafe for Authenticator
impl Send for Authenticator
impl Sync for Authenticator
impl Unpin for Authenticator
impl !UnwindSafe for Authenticator
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