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.
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.