pub trait AuthenticationProvider: Send + Sync {
// Required methods
fn method(&self) -> &str;
fn create(
&self,
rng: &Rng,
config: &HashMap<String, String>,
) -> Result<HashMap<String, String>>;
fn authenticate(
&self,
stored: &HashMap<String, String>,
credentials: &HashMap<String, String>,
) -> Result<AuthStep>;
}Required Methods§
Sourcefn method(&self) -> &str
fn method(&self) -> &str
The method name this provider handles (e.g., “password”, “token”, “solana”).
Sourcefn create(
&self,
rng: &Rng,
config: &HashMap<String, String>,
) -> Result<HashMap<String, String>>
fn create( &self, rng: &Rng, config: &HashMap<String, String>, ) -> Result<HashMap<String, String>>
Create stored credentials from configuration.
Called during CREATE AUTHENTICATION ... FOR USER ....
The rng parameter provides deterministic randomness in test mode.
Sourcefn authenticate(
&self,
stored: &HashMap<String, String>,
credentials: &HashMap<String, String>,
) -> Result<AuthStep>
fn authenticate( &self, stored: &HashMap<String, String>, credentials: &HashMap<String, String>, ) -> Result<AuthStep>
Authenticate a user given their stored credentials and the presented credentials.
For single-step methods (password, token), this returns Authenticated or Failed.
For challenge-response methods, this may return Challenge with data the client
must respond to, followed by a second call with the response.