Verifies a token sent with an HTTP request.
Verifies a token sent with an HTTP request.
Thanks to JwtAuthorizationMagnet, this directive works like the following functions,
authorizeToken[T](verifier: JWTClaimsSet => Option[T]) (implicit confirmer: JWSObject => Option[JWTClaimsSet]): Directive1[T] authorizeToken[T](extractor: Directive1[Option[JWSObject]], verifier: JWTClaimsSet => Option[T]) (implicit confirmer: JWSObject => Option[JWTClaimsSet]): Directive1[T]
This directive
extractor
.confirmer
.verifier
.verifier
to the inner route.Rejects
extractor
cannot extract a JWS from the request,confirmer
cannot confirm the signature of a JWS,confirmer
cannot extract the claims set from a JWS,verifier
rejects the claims set.UserPassAuthenticator
that returns a JWS object if a given pair of
a user and a password is authenticated.
UserPassAuthenticator
that returns a JWS object if a given pair of
a user and a password is authenticated.
Useful if combined with BasicAuth
and an authenticate
directive.
An inner route of an authenticate
directive will receive a JSON Web
Signature object (JWSObject
) built by claimsBuilder
and signed by
signer
.
Outcome type of authenticator
.
Authenticates a given pair of a user and a password.
Builds a claims set from the authentication result.
Signs the claims set and creates a JSON Web Signature.
Execution context where a Future
returned from authenticator
runs.
Companion object of JwtDirectives.