-
Notifications
You must be signed in to change notification settings - Fork 61
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
Question - Magic Link Continuation not working when password option available #110
Comments
@rtufisi can you please take a look? |
I will investigate it. |
Hello @ulevitsky . I think this is a limitation of the 'Magic link continuation authenticator' since the pooling is done by refreshing the authenticator tab. If you have a flow configuration like the following: And select the alternative 'Authenticator Application' and refresh the page, you will be redirected to the 'Password' flow. I will investigate other options for the pooling behaviour |
The page has a built in 5s timeout that refreshes the page, which likely puts them back at the beginning. The beginning page won't then poll to know if the link was clicked in another view. If you refresh that password page after the link is clicked, do you then log in? |
@pnzrr thank you for your suggestion, and to @rtufisi for your continued investigation! Unfortunately, no, if I reload the page after the link is clicked, it returns to the beginning of the flow (i.e. the password prompt). I experimented with a possible quick and dirty solution by attempting to replace this section of code with a fetch request -- something along these lines:
If magic link continuation is the only option, this is more or less functionally equivalent to current code in main branch, although weirdly after the link is clicked, the server may return one or two HTTP 500 before eventually returning a 302. However if password is also enabled, the backend never returns 302 after the link is clicked, instead continuing to return HTTP 200, which suggests there is something happening on the server side too -- but that's way beyond my skill level. |
Thanks @ulevitsky . I think the 500 you are experiencing is related to this issue #111 |
Observed with
quay.io/phasetwo/phasetwo-keycloak:26.1.2
image and docker compose file from https://github.com/p2-inc/phasetwo-containers/blob/main/examples/postgres/docker-compose.yml, with minimal additional configuration:*
for Valid redirect URIs, Valid post logout redirect URIs, Web origins.I then initiate authentication flow by opening
http://localhost:8080/realms/test/protocol/openid-connect/auth?client_id=test&response_type=code&redirect_uri=https://example.com
in browser.Overview
I'm implementing an authentication flow that offers users two options:
For reference, this is the flow I came up with.
Observed behavior
When both authentication methods are available:
However, when magic link is the only available option (user has no password or password form is disabled), everything works correctly:
/login-actions/authenticate
endpoint repeatedlyExpected behavior
The magic link continuation flow should work regardless of whether the password option is available.
Questions
Any advice would be greatly appreciated!
The text was updated successfully, but these errors were encountered: