Package org.nuxeo.ecm.jwt
Class JWTServiceImpl.JWTBuilderImpl
java.lang.Object
org.nuxeo.ecm.jwt.JWTServiceImpl.JWTBuilderImpl
- All Implemented Interfaces:
JWTService.JWTBuilder
- Enclosing class:
- JWTServiceImpl
Implementation of
JWTService.JWTBuilder
delegating to the auth0 JWT library.- Since:
- 10.3
-
Field Details
-
builder
public final com.auth0.jwt.JWTCreator.Builder builder
-
-
Constructor Details
-
JWTBuilderImpl
public JWTBuilderImpl()
-
-
Method Details
-
withTTL
Description copied from interface:JWTService.JWTBuilder
Adds a TTL (in seconds) to the token to be built.A negative or zero TTL means to use the platform default.
- Specified by:
withTTL
in interfaceJWTService.JWTBuilder
- Parameters:
ttlSeconds
- the TTL, in seconds
-
withClaim
Description copied from interface:JWTService.JWTBuilder
Adds a claim to the token to be built. The standard claim names are available inJWTClaims
.- Specified by:
withClaim
in interfaceJWTService.JWTBuilder
- Parameters:
name
- the claim namevalue
- the claim value
-
build
Description copied from interface:JWTService.JWTBuilder
Builds and returns the token.The
JWTClaims.CLAIM_SUBJECT
of the token is set to the current user id. TheJWTClaims.CLAIM_ISSUER
of the token is set to the string"nuxeo"
.The token hash algorithm is based on a secret provided by the service configuration.
- Specified by:
build
in interfaceJWTService.JWTBuilder
- Returns:
- the token
-