Package org.pac4j.jwt.profile
Class JwtGenerator
java.lang.Object
org.pac4j.jwt.profile.JwtGenerator
Generates a JWT token from a user profile.
- Since:
- 1.8.0
- Author:
- Jerome Leleu
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJwtGenerator(SignatureConfiguration signatureConfiguration) JwtGenerator(SignatureConfiguration signatureConfiguration, EncryptionConfiguration encryptionConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.nimbusds.jwt.JWTClaimsSetbuildJwtClaimsSet(org.pac4j.core.profile.UserProfile profile) Generate a JWT from a map of claims.generate(org.pac4j.core.profile.UserProfile profile) Generate a JWT from a user profile.protected StringinternalGenerate(com.nimbusds.jwt.JWTClaimsSet claimsSet) Generate a JWT from a claims set.voidsetEncryptionConfiguration(EncryptionConfiguration encryptionConfiguration) voidsetExpirationTime(Date expirationTime) voidsetSignatureConfiguration(SignatureConfiguration signatureConfiguration) toString()protected voidverifyProfile(org.pac4j.core.profile.UserProfile profile)
-
Field Details
-
INTERNAL_ROLES
- See Also:
-
INTERNAL_PERMISSIONS
- See Also:
-
INTERNAL_LINKEDID
- See Also:
-
-
Constructor Details
-
JwtGenerator
public JwtGenerator() -
JwtGenerator
-
JwtGenerator
public JwtGenerator(SignatureConfiguration signatureConfiguration, EncryptionConfiguration encryptionConfiguration)
-
-
Method Details
-
generate
Generate a JWT from a map of claims.- Parameters:
claims- the map of claims- Returns:
- the created JWT
-
generate
Generate a JWT from a user profile.- Parameters:
profile- the given user profile- Returns:
- the created JWT
-
internalGenerate
Generate a JWT from a claims set.- Parameters:
claimsSet- the claims set- Returns:
- the JWT
-
verifyProfile
protected void verifyProfile(org.pac4j.core.profile.UserProfile profile) -
buildJwtClaimsSet
protected com.nimbusds.jwt.JWTClaimsSet buildJwtClaimsSet(org.pac4j.core.profile.UserProfile profile) -
getSignatureConfiguration
-
setSignatureConfiguration
-
getEncryptionConfiguration
-
setEncryptionConfiguration
-
getExpirationTime
-
setExpirationTime
-
toString
-