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

Failed to get login flow when going back in the browser history #279

Open
natalian98 opened this issue Sep 10, 2024 · 7 comments
Open

Failed to get login flow when going back in the browser history #279

natalian98 opened this issue Sep 10, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@natalian98
Copy link
Contributor

If you log in with email and password, login ui redirects to complete the 2fa. If instead of providing it you go back in the browser and attempt to sign in again, a Failed to get login flow error will be displayed:
image
In login ui logs:

"message":"Error when getting login flow: 403 Forbidden\n"

The solution is to 1) clear the browser cookies or 2) go again to the original url which will redirect to insert the password again (the email is cached).

@natalian98 natalian98 added the bug Something isn't working label Sep 10, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/IAM-1051.

This message was autogenerated

@lukasSerelis
Copy link

Ideally this situation should not occur at all, and we could do this by providing better back-tracking ways in UI. Is there a way to give user a way back that wouldn't cause this error?

If we can not do that, we need to give a better error message in this case. Ideally not showing sign-in options at all and just showing an error screen as now it's indicating that something is wrong with inputs in the fields, whereas the real issue is that they need to clear cookies or start from the original sign in url.

So ideally the flow is either an accurate error or a button that doesn't break the UI
image

@nsklikas
Copy link
Contributor

I am unable to reproduce this issue for some time now, can you verify that it's still happening and provide more precise instructions?

@lukasSerelis
Copy link

I am unable to reproduce this issue for some time now, can you verify that it's still happening and provide more precise instructions?

https://iam.dev.canonical.com/stg-identity-jaas-dev-grafana-k8s/login~ happening here still

@nsklikas
Copy link
Contributor

nsklikas commented Sep 27, 2024

This error happens on chromium, can't reproduce it on firefox.

Looks like on chromium the back does not trigger the browser to fetch the page again, this results in trying to re-use the existing flow. Whereas on firefox I think that a new flow is created.

@lukasSerelis
Copy link

Anything we can do for chromium?

@edlerd
Copy link
Contributor

edlerd commented Sep 28, 2024

This is due to bfcache. It can be disabled with a header Cache-Control: "no-cache, no-store, must-revalidate", that we probably want to set on all responses of login ui.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants