Skip to main content

Authenticator

Trait Authenticator 

Source
pub trait Authenticator {
    // Required method
    async fn get_token(&self) -> Result<String>;
}
Expand description

Defines the interface for an OAuth2 authentication flow.

Implementors are responsible for performing the full token exchange and returning a raw access token string on success.

§Implementors

Required Methods§

Source

async fn get_token(&self) -> Result<String>

Performs the authentication flow and returns a raw access token.

§Errors

Returns an error if the token exchange fails for any reason, such as invalid credentials, network issues, or a rejected authorization.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§