Hi
My pac4j version is 5.1.3
I use JwtGenerator want to generate an token,like code below:
final SecretSignatureConfiguration secretSignatureConfiguration = new SecretSignatureConfiguration(salt);
final SecretEncryptionConfiguration secretEncryptionConfiguration = new SecretEncryptionConfiguration(salt);
final JwtGenerator generator = new JwtGenerator();
generator.setSignatureConfiguration(secretSignatureConfiguration);
generator.setEncryptionConfiguration(secretEncryptionConfiguration);
String token = "";
saved by an indirect client (from the UserInterfaceApplication)
final Optional<UserProfile> profile = profileManager.getProfile();
profileManager.removeProfiles();
if (profile.isPresent()) {
token = generator.generate(profile.get());
}
And I add this parameter to Header and user by HeaderClient.
I find it is faild In OidcProfile 166L method getTokenExpirationAdvance()
public int getTokenExpirationAdvance() {
var tokenExpirationAdvance = getAttribute(OidcProfileDefinition.TOKEN_EXPIRATION_ADVANCE);
return tokenExpirationAdvance != null ? (int) tokenExpirationAdvance : -1;
}
because nimbus parse all Number to Long and in this code it compulsory type a Long to int.
So it turn "nested exception is java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.Integer"
I believe it is easy to fix this bug . But other bug cause by nimbus parse all Number to Long maybe still not found.
Regards
Augustus