pub trait Authenticate:
Sized
+ Send
+ 'static {
type Credentials: FromRequestParts;
// Required method
fn authenticate(
credentials: Self::Credentials,
required: &[&'static str],
parts: &Parts,
) -> impl Future<Output = Result<Self, ApiError>> + Send;
}Expand description
User-defined principal built from a scheme’s credentials.
authenticate receives the scopes the endpoint requires and the request
[Parts]; application state set with App::with_state is reachable
through parts.extensions. Return 401 for invalid credentials and
403 (see check_scopes) for missing scopes.
Required Associated Types§
Sourcetype Credentials: FromRequestParts
type Credentials: FromRequestParts
The scheme that supplies the credentials.
Required Methods§
Sourcefn authenticate(
credentials: Self::Credentials,
required: &[&'static str],
parts: &Parts,
) -> impl Future<Output = Result<Self, ApiError>> + Send
fn authenticate( credentials: Self::Credentials, required: &[&'static str], parts: &Parts, ) -> impl Future<Output = Result<Self, ApiError>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".