Magnet that attracts parameters necessary for the authorizeToken
directive.
Magnet that attracts parameters necessary for the authorizeToken
directive.
Outcome type of verifier
.
Extracts a JSON Web Signature (JWS) from an HTTP request.
Confirms the signature of the JWS and extracts the claims set.
Verifiers the claims set and converts it to an application-specific object.
Claim builder.
Claim builder.
You can chain multiple claim builders by &&
operator.
Verifies a claims set.
Verifies a claims set.
Instance of this trait can be passed as a verifier
argument of the
authorizeToken
directive.
Provides utilities for building, signing and verification of a JSON Web Token (JWT).
Provides signature signer and verifier for JWS.
Provides signature signer and verifier for JWS.
Name of the signature algorithm.
Secret key for the signature algorithm.
Provides common JWS extractors.
Companion object of JwtAuthorizationMagnet.
Companion object of JwtClaimBuilder.
Companion object of JwtClaimVerifier.
Companion object of JwtDirectives.
Provides utilities for signing and verifying the JSON Web Token (JWT).
Only JSON Web Signature (JWS) is supported.
Please refer to OAuth Working Group Draft for details about JWT.
The implementation is powered by Nimbus JOSE + JWT.
Signing
Signing is designed to be done when a Basic authentication succeeds. The function JwtDirectives.jwtAuthenticator returns a
UserPassAuthenticator
which authenticates a given pair of user and password, builds a claims set and signs it. Both claims set buildind and signing functions are implicitly given to JwtDirectives.jwtAuthenticator.JwtClaimBuilder helps defining a claims set building function.
JwtSignature helps defining a signing function.
Verification
There is a directive JwtDirectives.authorizeToken which verifies and privileges a given JWT. A verification function is implicitly given to JwtDirectives.authorizeToken.
JwtSignature helps defining a verification function.
JwtClaimVerifier helps defining a privileging function.
Example
The following is an example derived from the example of the authenticate directive.