Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stepup issue on "remember_me" authentication : alreadyLoggedIn #17539

Closed
2 tasks done
etchepar opened this issue Mar 9, 2023 · 4 comments · Fixed by #19459
Closed
2 tasks done

Stepup issue on "remember_me" authentication : alreadyLoggedIn #17539

etchepar opened this issue Mar 9, 2023 · 4 comments · Fixed by #19459
Assignees
Labels
area/authentication Indicates an issue on Authentication area kind/bug Categorizes a PR related to a bug
Milestone

Comments

@etchepar
Copy link
Contributor

etchepar commented Mar 9, 2023

Before reporting an issue

  • I have searched existing issues
  • I have reproduced the issue with the latest release

Area

authentication

Describe the bug

We made a jump in version from KC 17 to KC 20.
Since then we noticed an increasing number of users complaining the apparition of the alreadyLoggedIn message.

The bug appears with a "remember me" session, and when after the user restarts its browser (deleting session cookie as AUTH_SESSION_ID but keeping the KEYCLOAK_IDENTITY one since it's a persistent cookie due to "remember_me").
If the authentication flow contains an authenticator that trigger a form, then the submit of this form results in the display of on a "alreadylogin" message.

This can be shown on a with standard stepup flow at the OTP step (https://www.keycloak.org/docs/latest/server_admin/#_step-up-flow)

Version

20.0.3

Expected behavior

On a "remember me" session,
When the browser is closed and reopened (cleaning session cookies but keeping persistent cookies)
And the user triggers an authentication flow needing a user interaction (like in stepup flow)

Then the authentication flows is not blocked by an "alreadyLoggedIn" error message

Actual behavior

On a "remember me" session,
When the browser is closed and reopened (cleaning session cookies but keeping persistent cookies)
And the user triggers an authentication flow needing a user interaction (like in stepup flow)

Then an alreadyLoggedIn error message is displayed

How to Reproduce?

The bug appears when the authentication flow contains an authenticator that needs a user interaction (a form to be submited)

Prerequisite :
the STEPUP flow is enabled (see )

1 - the user authenticates itself with the "remember me" feature
2 - the user close all instances of his browser
3 - the user opens his browser
4 - the user triggers a stepup auth (via the request parameter acr_values=2 in the oidc authentication request for instance)
5 - The OTP is then required
6 - When the user submit the form the OTP the error message is displayed

Anything else?

No response

@etchepar etchepar added kind/bug Categorizes a PR related to a bug status/triage labels Mar 9, 2023
@ghost ghost added area/authentication Indicates an issue on Authentication area team/core labels Mar 9, 2023
@etchepar
Copy link
Contributor Author

etchepar commented Mar 9, 2023

@etchepar
Copy link
Contributor Author

etchepar commented Mar 14, 2023

In my investigation, I thought of two first proposals :
1 - recreate the missing auth session id cookie (ot only when an old cookie needs to be reencoded (see PR #17662)
2 - change the behaviour of the initialVerifyAuthSession method of the SessionCodeChecks class

@remigauthierdocaposte
Copy link

Thanks for this report. I am also interested by an answer around this issue.

@mposolda mposolda added this to the 22.0.0 milestone Mar 24, 2023
@mposolda
Copy link
Contributor

Adding to Keycloak 22 as this looks like a regression and worth investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/authentication Indicates an issue on Authentication area kind/bug Categorizes a PR related to a bug
Projects
None yet
5 participants