public String create ( Consumer < JWTCreator . Builder > jwtBuilderConsumer ) { Date issueTime = new Date ( ) ; Date expirationTime = new Date ( issueTime . getTime ( ) + defaultExpirationMs ) ; JWTCreator . Builder builder = JWT . create ( ) // opinionated creation, we enforce using an expiration . withIssuer ( issuer ) . withIssuedAt ( issueTime ) . withExpiresAt ( expirationTime ) ; // apply any additional token customisation jwtBuilderConsumer . accept ( builder ) ; return sign ( builder ) ; }
Creates a JWT token .