mirror of
https://github.com/plankanban/planka.git
synced 2026-02-05 00:39:58 +03:00
SSO Redirect Post Enrollment Error #445
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tomlyo on GitHub (Mar 22, 2024).
I'm finding an issue when new users sign up for an account on Planka via my IDP. Steps to recreate the issue are below:
Planka V1.16.0

Authentik V2024.2.2
Docker-Compose:
@meltyshev commented on GitHub (Mar 25, 2024):
Hi and thanks for reporting this!
As far as I understand, it doesn't happen every time when logging in as a new user? I've tried to reproduce this several times, but have never had this problem.
But we definitely need to add more detailed error output.
@tomlyo commented on GitHub (Mar 26, 2024):
Hi,
That is correct, it only happens immediately after a user enrolls, and is redirected back to planka. I've tried inspecting the headers and request data when the user clicks the link in the email to Authentik then back to Planka, versus just clicking the "Sign in with SSO", and they appear to be the same.
No better way of showcasing an issue than a video though (45 seconds showcasing the error):
https://github.com/plankanban/planka/assets/90040568/15013e0d-46e6-4d6a-b4bf-34fcc97109ab
Note: This is a test environment that was set up specifically for this purpose. The issue was originally present in a # "production environment".
@meltyshev commented on GitHub (Mar 26, 2024):
Thanks for the video!
Now I see what the problem is. Before redirecting from Planka to Authentik we create an
oidc-statevariable and store it in thesessionStorage, it's needed for better security, so that we can verify that it was you who pressed the "Log in With SSO" button. But when you follow a link from the email, another tab opens whereoidc-stateis missing (sincesessionStorageonly works for the current session). Then when redirecting back to Planka, we check ifoidc-statematches and since it's not present at all, we immediately output an error and don't even send any requests to the server.When testing I missed the step that you received the link in an email, my bad. I'll try a quick fix for this, but first I need to research a bit if there's anything wrong in terms of security if storing
oidc-stateto more than just the current tab.@meltyshev commented on GitHub (Mar 26, 2024):
It seems that there should be no security issues if we replace
sessionStoragewithlocalStorageand in that case it will work correctly. Checked the description of thestateparameter in the documentation, the oidc-client-ts library useslocalStorageand the same in the example here: https://auth0.com/docs/get-started/authentication-and-authorization-flow/implicit-flow-with-form-post/mitigate-replay-attacks-when-using-the-implicit-flow#persist-nonces-across-requests.