public class JWTServiceImpl extends DefaultComponent implements JWTService
Modifier and Type | Class and Description |
---|---|
class |
JWTServiceImpl.JWTBuilderImpl
Implementation of
JWTBuilder delegating to the auth0 JWT library. |
protected static class |
JWTServiceImpl.JWTServiceConfigurationRegistry |
JWTService.JWTBuilder
Modifier and Type | Field and Description |
---|---|
protected static com.fasterxml.jackson.core.type.TypeReference<Map<String,Object>> |
MAP_STRING_OBJECT |
static String |
NUXEO_ISSUER |
protected static com.fasterxml.jackson.databind.ObjectMapper |
OBJECT_MAPPER |
protected JWTServiceImpl.JWTServiceConfigurationRegistry |
registry |
static String |
XP_CONFIGURATION |
lastModified, name
Constructor and Description |
---|
JWTServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
builderWithClaim(com.auth0.jwt.JWTCreator.Builder builder,
String name,
Object value) |
protected com.auth0.jwt.algorithms.Algorithm |
getAlgorithm() |
protected int |
getDefaultTTL() |
protected static <T> T |
getFieldValue(Object object,
String name) |
JWTService.JWTBuilder |
newBuilder()
Creates a new builder for a JSON Web Token.
|
protected static Object |
nodeToValue(com.fasterxml.jackson.databind.JsonNode node)
Converts a
JsonNode to a Java value. |
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
Map<String,Object> |
verifyToken(String token)
Verifies the token and returns its claims, or
null if the token is invalid (corrupted, constructed from
an invalid secret, or expired). |
activate, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted, getApplicationStartedOrder
public static final String XP_CONFIGURATION
public static final String NUXEO_ISSUER
protected static final com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER
protected static final com.fasterxml.jackson.core.type.TypeReference<Map<String,Object>> MAP_STRING_OBJECT
protected final JWTServiceImpl.JWTServiceConfigurationRegistry registry
public JWTServiceImpl()
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
public JWTService.JWTBuilder newBuilder()
JWTService
newBuilder
in interface JWTService
protected void builderWithClaim(com.auth0.jwt.JWTCreator.Builder builder, String name, Object value)
public Map<String,Object> verifyToken(String token)
JWTService
null
if the token is invalid (corrupted, constructed from
an invalid secret, or expired).
The claim JWTClaims.CLAIM_SUBJECT
contains the token's creator user id.
The token hash algorithm is based on a secret provided by the service configuration.
verifyToken
in interface JWTService
token
- the tokennull
if the token is invalidprotected static Object nodeToValue(com.fasterxml.jackson.databind.JsonNode node)
JsonNode
to a Java value.protected int getDefaultTTL()
protected com.auth0.jwt.algorithms.Algorithm getAlgorithm()
protected static <T> T getFieldValue(Object object, String name)
Copyright © 2018 Nuxeo. All rights reserved.