Skip to main content

Authenticator

Trait Authenticator 

Source
pub trait Authenticator: Send + Sync {
    // Required method
    fn authenticate(
        &self,
        credentials: Option<&str>,
    ) -> Result<UsernamePasswordToken, SecurityError>;
}
Expand description

Turns request credentials into a UsernamePasswordToken.

Required Methods§

Source

fn authenticate( &self, credentials: Option<&str>, ) -> Result<UsernamePasswordToken, SecurityError>

Authenticates using the raw header value (for example Bearer … or an API key).

§Errors

Returns SecurityError::Authentication when credentials are invalid.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§