You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having an issue with renewing the profile after has expired (for OIDC flow).
The problem arises because the profile is cleared every time in the ProfileManager, as the class has not set the config. Consequently, the profile is never renewed.
Take a look at the code:
In Pac4JModule the current user is set as follows:
Here, we have an initialized ProfileManager without a config. The config should probably be set using the public method of ProfileManager setConfig(Config config).
The getProfile method calls the removeOrRenewExpiredProfiles method in ProfileManager, which includes the following condition:
protectedvoidremoveOrRenewExpiredProfiles(finalLinkedHashMap<String, UserProfile> profiles, finalbooleanreadFromSession) {
varprofilesUpdated = false;
for (finalvarentry : profiles.entrySet()) {
finalvarkey = entry.getKey();
finalvarprofile = entry.getValue();
if (profile.isExpired()) {
LOGGER.debug("Expired profile: {}", profile);
profilesUpdated = true;
profiles.remove(key);
if (config != null && profile.getClientName() != null) {
finalvarclient = config.getClients().findClient(profile.getClientName());
if (client.isPresent()) {
try {
finalvarnewProfile = client.get().renewUserProfile(profile, context, sessionStore);
if (newProfile.isPresent()) {
LOGGER.debug("Renewed by profile: {}", newProfile);
profiles.put(key, newProfile.get());
}
} catch (finalRuntimeExceptione) {
logger.error("Unable to renew the user profile for key: {}", key, e);
}
}
}
}
}
if (profilesUpdated) {
saveAll(profiles, readFromSession);
}
}
In the method you see the condition
if (config != null && profile.getClientName() != null) {
I suspect that this condition will always be null when ProfileManager is called by Pac4jCurrentUser, resulting in the profile always being cleared.
Could you please advise me on how to bypass this problem? Or perhaps it should be fixed?
Thank you.
The text was updated successfully, but these errors were encountered:
Hello,
I'm having an issue with renewing the profile after has expired (for OIDC flow).
The problem arises because the profile is cleared every time in the ProfileManager, as the class has not set the config. Consequently, the profile is never renewed.
Take a look at the code:
In Pac4JModule the current user is set as follows:
The current user class has the following method:
Here, we have an initialized ProfileManager without a config. The config should probably be set using the public method of ProfileManager setConfig(Config config).
The getProfile method calls the
removeOrRenewExpiredProfiles
method inProfileManager
, which includes the following condition:In the method you see the condition
I suspect that this condition will always be null when ProfileManager is called by Pac4jCurrentUser, resulting in the profile always being cleared.
Could you please advise me on how to bypass this problem? Or perhaps it should be fixed?
Thank you.
The text was updated successfully, but these errors were encountered: