pub trait Authenticate {
// Required methods
fn describe(&self) -> Result<AuthenticatorInfo>;
fn authenticate(
&self,
auth: &RequestAuth,
meta: Option<ConnectionMetadata>,
) -> Result<Application>;
}Expand description
Authentication interface
Interface that must be implemented for each authentication type available for the service.
Required Methods§
Sourcefn describe(&self) -> Result<AuthenticatorInfo>
fn describe(&self) -> Result<AuthenticatorInfo>
Return a description of the authenticator.
The descriptions are gathered in the Core Provider and returned for a ListAuthenticators operation.
Sourcefn authenticate(
&self,
auth: &RequestAuth,
meta: Option<ConnectionMetadata>,
) -> Result<Application>
fn authenticate( &self, auth: &RequestAuth, meta: Option<ConnectionMetadata>, ) -> Result<Application>
Authenticates a RequestAuth payload and returns the Application if successful. A
optional ConnectionMetadata object is passed in too, since it is sometimes possible to
perform authentication based on the connection’s metadata (i.e. as is the case for UNIX
domain sockets with Unix peer credentials).
§Errors
If the authentification fails, returns a ResponseStatus::AuthenticationError.