Vapor Documentation Beta

Protocol Request​Authenticator

public protocol RequestAuthenticator: Authenticator

Help for creating authentication middleware based on Request.

Authenticator's use the incoming request to check for authentication information. If valid authentication credentials are present, the authenticated user is added to req.auth.

%3 RequestAuthenticator RequestAuthenticator Authenticator Authenticator RequestAuthenticator->Authenticator CredentialsAuthenticator CredentialsAuthenticator CredentialsAuthenticator->RequestAuthenticator BasicAuthenticator BasicAuthenticator BasicAuthenticator->RequestAuthenticator BearerAuthenticator BearerAuthenticator BearerAuthenticator->RequestAuthenticator

Conforms To

Authenticator

Helper for creating authentication middleware.

Types Conforming to Request​Authenticator

BasicAuthenticator

Helper for creating authentication middleware using the Basic authorization header.

BearerAuthenticator

Helper for creating authentication middleware using the Bearer authorization header.

CredentialsAuthenticator

Helper for creating authentication middleware using request body contents.

Requirements

authenticate(request:​)

func authenticate(request: Request) -> EventLoopFuture<Void>