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
ConstructorsConstructorDescriptionConstructor for JwtGenerator.JwtGenerator(SignatureConfiguration signatureConfiguration) Constructor for JwtGenerator.JwtGenerator(SignatureConfiguration signatureConfiguration, EncryptionConfiguration encryptionConfiguration) Constructor for JwtGenerator. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.nimbusds.jwt.JWTClaimsSetbuildJwtClaimsSet(UserProfile profile) buildJwtClaimsSet.Generate a JWT from a map of claims.generate(UserProfile profile) Generate a JWT from a user profile.Getter for the fieldexpirationTime.protected StringinternalGenerate(com.nimbusds.jwt.JWTClaimsSet claimsSet) Generate a JWT from a claims set.voidsetExpirationTime(Date expirationTime) Setter for the fieldexpirationTime.protected voidverifyProfile(UserProfile profile) verifyProfile.
-
Field Details
-
INTERNAL_ROLES
ConstantINTERNAL_ROLES="$int_roles"- See Also:
-
INTERNAL_LINKEDID
ConstantINTERNAL_LINKEDID="$int_linkid"- See Also:
-
-
Constructor Details
-
JwtGenerator
public JwtGenerator()Constructor for JwtGenerator.
-
JwtGenerator
Constructor for JwtGenerator.
- Parameters:
signatureConfiguration- aSignatureConfigurationobject
-
JwtGenerator
public JwtGenerator(SignatureConfiguration signatureConfiguration, EncryptionConfiguration encryptionConfiguration) Constructor for JwtGenerator.
- Parameters:
signatureConfiguration- aSignatureConfigurationobjectencryptionConfiguration- aEncryptionConfigurationobject
-
-
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
verifyProfile.
- Parameters:
profile- aUserProfileobject
-
buildJwtClaimsSet
buildJwtClaimsSet.
- Parameters:
profile- aUserProfileobject- Returns:
- a
JWTClaimsSetobject
-
getExpirationTime
Getter for the field
expirationTime.- Returns:
- a
Dateobject
-
setExpirationTime
Setter for the field
expirationTime.- Parameters:
expirationTime- aDateobject
-