keycloak-home-idp-discovery icon indicating copy to clipboard operation
keycloak-home-idp-discovery copied to clipboard

[BUG] On re-authentiction the currently logged in user is ignored

Open BlackVoid opened this issue 5 months ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

Alt1.

  1. Login to keycloak wth any application
  2. Wait until a re-authentication is required (not sure about exact time but about 5 minutes)
  3. Trigger a login from a app with a action included ex. kc_action=UPDATE_PROFILE
  4. Form is shown with attempted user being the user I'm logged in as and email field is empty
  5. User has to enter the username or select the IDP
  6. Eventually user gets to the update profile form

image

Alt2.

  1. Login to keycloak wth any application
  2. Wait until a re-authentication is required (not sure about exact time but about 5 minutes)
  3. Trigger a login from a app with a action included ex. kc_action=UPDATE_PROFILE and include login_hint=myemail
  4. Get redirected to 3rd party IDP and then redirected back to Keycloak
  5. Update profile form is shown

Expected Behavior

Behavior of Alt1 should be that the user that of Alt2 after step 3 i.e:

  1. Login to keycloak wth any application
  2. Wait until a re-authentication is required (not sure about exact time but about 5 minutes)
  3. Trigger a login from a app with a action included ex. kc_action=UPDATE_PROFILE
  4. Get redirected to 3rd party IDP and then redirected back to Keycloak
  5. Update profile form is shown

If I don't have a IDP connected to the user and it only has a password it also works as expected, see the following image

image

Steps To Reproduce

Configure the browser flow to contain the following steps:

  • Cookie - Alternative
  • Home IdP Discovery - Alternative
    • User attribute: email
    • Forward users with unverified email: true
    • Bypass login page: true
    • Forward to linked IdP: true
    • Forward to first matched IdP: false
  • Password Form (used during re-authentiction) - Alternative
  • Username Password Form (used during login) - Alternative

Alt1.

  1. With a user connected to any 3rd party IdP
  2. Login to keycloak wth any application
  3. Wait until a re-authentication is required (not sure about exact time but about 5 minutes)
  4. Trigger a login from a app with a action included ex. kc_action=UPDATE_PROFILE
  5. Form is shown with attempted user being the user I'm logged in as and email field is empty
  6. User has to enter the username or select the IDP
  7. Eventually user gets to the update profile form

image

Alt2.

  1. With a user connected to any 3rd party IdP
  2. Login to keycloak wth any application
  3. Wait until a re-authentication is required (not sure about exact time but about 5 minutes)
  4. Trigger a login from a app with a action included ex. kc_action=UPDATE_PROFILE and include login_hint=myemail
  5. Get redirected to 3rd party IDP and then redirected back to Keycloak
  6. Update profile form is shown

Version

- Keycloak: 23.0.4
- This extension: 23.0.0

Anything else?

No response

BlackVoid avatar Jan 24 '24 14:01 BlackVoid