Verifies a token sent with an HTTP request.
Verifies a token sent with an HTTP request.
A token should be sent through the Authorization
header like,
Authorization: Bearer JWT
Thanks to JwtAuthorizationMagnet, this directive will end up the following form,
authorizeToken[T](privilege: JWTClaimsSet => Option[T]) (implicit verifier: JWSObject => Option[JWTClaimsSet]): Directive1[T]
And will
verifier
and extract a claim set.privilege
to the claim set.privilege
to the inner route.Will reject,
verifier
cannot verify the JWT,privilege
rejects the claims set.A UserPassAuthenticator
which returns a JWS object if a given pair of
a user and a password is authenticated.
A UserPassAuthenticator
which 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 JWS object
(JWSObject
) built by claimBuilder
and signed by signer
.
The UserPassAuthenticator
which authenticates a given pair of a user
and a password.
Builds a claim set from a result of authenticator
.
Signs a result of claimBuilder
.
The execution context to run a Future
returned from authenticator
.
The companion object of JwtDirectives.