Interface JWTService.JWTBuilder

    • Method Detail

      • withTTL

        JWTService.JWTBuilder withTTL​(int ttlSeconds)
        Adds a TTL (in seconds) to the token to be built.

        A negative or zero TTL means to use the platform default.

        Parameters:
        ttlSeconds - the TTL, in seconds
      • withClaim

        JWTService.JWTBuilder withClaim​(String name,
                                        Object value)
        Adds a claim to the token to be built. The standard claim names are available in JWTClaims.
        Parameters:
        name - the claim name
        value - the claim value
      • build

        String build()
        Builds and returns the token.

        The JWTClaims.CLAIM_SUBJECT of the token is set to the current user id. The JWTClaims.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.

        Returns:
        the token