public final class JwtUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
NONCE
Claim-set nonce key - not available in JwtClaimsSetKey.
|
Modifier and Type | Method and Description |
---|---|
static Optional<String> |
getCookieJwt(Request request,
String name)
Get a JWT from a request, with a given cookie name.
|
static Optional<String> |
getFormJwt(Request request,
String param)
Get the JWT from a request form parameter.
|
static Optional<String> |
getValue(JwtClaimsSet claimsSet,
JsonPointer ptr)
Return a value from it's well-known location on the OAuth2 authorization JWT.
|
static <T extends Jwt> |
reconstructJwt(String jwt,
Class<T> jwtClass)
Reconstruct a JWT from a {code String} representation.
|
public static final String NONCE
public static Optional<String> getCookieJwt(Request request, String name)
request
- The request from which to obtain the JWT.name
- The name of the cookie storing the JWT.String
representationpublic static Optional<String> getFormJwt(Request request, String param)
request
- The request from which to obtain the JWT.param
- The name of the parameter holding the JWT.String
JWT representationpublic static <T extends Jwt> T reconstructJwt(String jwt, Class<T> jwtClass)
T
- type of JWT
to construct.jwt
- The JWT String representation.jwtClass
- The JWT class type to construct.public static Optional<String> getValue(JwtClaimsSet claimsSet, JsonPointer ptr)
claimsSet
- The JWT claims set.ptr
- JsonPointer
referencing claim.String
containing valueCopyright 2011-2017 ForgeRock AS.