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
 
 public class JWTServiceImpl.JWTBuilderImpl extends Object implements JWTService.JWTBuilder Implementation ofJWTService.JWTBuilderdelegating to the auth0 JWT library.- Since:
- 10.3
 
- 
- 
Field SummaryFields Modifier and Type Field Description com.auth0.jwt.JWTCreator.Builderbuilder
 - 
Constructor SummaryConstructors Constructor Description JWTBuilderImpl()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringbuild()Builds and returns the token.JWTServiceImpl.JWTBuilderImplwithClaim(String name, Object value)Adds a claim to the token to be built.JWTServiceImpl.JWTBuilderImplwithTTL(int ttlSeconds)Adds a TTL (in seconds) to the token to be built.
 
- 
- 
- 
Method Detail- 
withTTLpublic JWTServiceImpl.JWTBuilderImpl withTTL(int ttlSeconds) 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 interface- JWTService.JWTBuilder
- Parameters:
- ttlSeconds- the TTL, in seconds
 
 - 
withClaimpublic JWTServiceImpl.JWTBuilderImpl withClaim(String name, Object value) Description copied from interface:JWTService.JWTBuilderAdds a claim to the token to be built. The standard claim names are available inJWTClaims.- Specified by:
- withClaimin interface- JWTService.JWTBuilder
- Parameters:
- name- the claim name
- value- the claim value
 
 - 
buildpublic String 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 interface- JWTService.JWTBuilder
- Returns:
- the token
 
 
- 
 
-