Skip to main content

CredentialAuthenticator

Trait CredentialAuthenticator 

Source
pub trait CredentialAuthenticator: Send + Sync {
    // Required method
    fn authenticate(&self, username: &str, password: &str) -> Option<User>;
}
Expand description

Trait for authenticators that can validate username/password credentials.

§Spring Equivalent

Similar to AuthenticationProvider that handles username/password authentication.

This trait is separate from Authenticator because it validates credentials directly rather than extracting them from a request.

Required Methods§

Source

fn authenticate(&self, username: &str, password: &str) -> Option<User>

Validate username and password, returning the user if valid.

Implementors§