Magnet that attracts parameters necessary for the authorizeToken
directive.
Claim builder.
Verifies a claims set.
Provides utilities for building, signing and verification of a JSON Web Token (JWT).
Provides signature signer and verifier for JWS.
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 verification by the JSON Web Token (JWT).
Only JSON Web Signature (JWS) is supported.
Please refer to OAuth Working Group Draft for details on JWT.
The implementation is powered by Nimbus JOSE + JWT.
Signing
Signing is supposed to be done when a Basic authentication has succeeded. There is a function JwtDirectives.jwtAuthenticator which returns a
UserPassAuthenticator
that authenticates a given pair of a user and a password, builds a claim set and signs it. Both claim set buildind and signing functions are implicitly given to JwtDirectives.jwtAuthenticator.JwtClaimBuilder helps defining a claim 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 an example of the authenticate directive.