Correct token access in LoginPreActions
Moved the logic for retrieving Keycloak tokens (ID token, subject) and logging the user into Moqui to occur only *after* the Keycloak authentication outcome is confirmed as AUTHENTICATED. Previously, the script attempted to access these tokens regardless of the authentication outcome, leading to errors (likely NullPointerException on idToken.getSubject()) when authentication failed or resulted in a challenge. This issue may have surfaced after the Keycloak upgrade to version 23. Added null checks for KeycloakSecurityContext and IDToken before accessing them.
Showing
1 changed file
with
37 additions
and
19 deletions
-
Please register or sign in to post a comment