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.JWTBuilderAdds a TTL (in seconds) to the token to be built.A negative or zero TTL means to use the platform default.
- Specified by:
withTTLin interfaceJWTService.JWTBuilder- Parameters:
ttlSeconds- the TTL, in seconds
-
withClaim
Description copied from interface:JWTService.JWTBuilderAdds a claim to the token to be built. The standard claim names are available inJWTClaims.- Specified by:
withClaimin interfaceJWTService.JWTBuilder- Parameters:
name- the claim namevalue- the claim value
-
build
Description copied from interface:JWTService.JWTBuilderBuilds and returns the token.The
JWTClaims.CLAIM_SUBJECTof the token is set to the current user id. TheJWTClaims.CLAIM_ISSUERof the token is set to the string"nuxeo".The token hash algorithm is based on a secret provided by the service configuration.
- Specified by:
buildin interfaceJWTService.JWTBuilder- Returns:
- the token
-