mirror of
https://github.com/plankanban/planka.git
synced 2026-02-25 03:14:50 +03:00
Difficulties setting up SSO #364
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 @SangeloDev on GitHub (Oct 16, 2023).
Hello there, I have difficulties setting up OIDC SSO with Authentik for Planka, I've tried following the example in the docs, but it's a bit hard for me to understand what I should do exactly.
Here's my current docker compose as a reference, with some infos redacted out:
What I am seeing on the login page:
What exactly should be happening? Have I configured something wrong?
Thanks for the help in advance, cheers!
@meltyshev commented on GitHub (Oct 16, 2023):
Hi! We still haven't released a version with OIDC, meaning it's only available in ghcr.io/plankanban/planka:dev.
I'm working on pre-release fixes right now, hopefully I'll be able to finalize it soon. You can also use the dev version, but after the full release you'll likely need to make some changes to the database.
@SangeloDev commented on GitHub (Oct 16, 2023):
Hi there! Thanks for the quick response. I'll probably wait it out then, better safe than sorry
Do you have a rough estimate as to when the release with OIDC support can release? If it's ways away, I might also just install the dev version
@meltyshev commented on GitHub (Oct 16, 2023):
I really want to do this right today 🙂 But it should definitely be ready this week if something goes wrong today.
@SangeloDev commented on GitHub (Oct 16, 2023):
Oh! That's amazing! I'll wait for the next release then :D
Thanks so much!
@meltyshev commented on GitHub (Oct 17, 2023):
Just made a release with OIDC: https://github.com/plankanban/planka/releases/tag/v1.13.0.
@SangeloDev commented on GitHub (Oct 23, 2023):
Hello, thanks a lot for the quick development!
I am having issues still with configuring Authentik to be an OIDC provider. When trying to log in, I get the following message in my browser console (along with an error above the login box stating that there is an unknown error):
I tried updating my original configuration (see above) using the example provided in the docs as a template. My current config looks like this:
Am I configuring something wrong? Thanks again for your help thus far!
@meltyshev commented on GitHub (Oct 23, 2023):
Hi! If you are getting this error, it's likely that your IDP doesn't support the
emailorprofilescopes.Please check that they are selected in the provider settings in Authentik:
Providers -> Edit -> Advanced protocol settings -> Scopes
Make sure they're specified in the
scopes_supportedwhen requesting https://auth.example.com/application/o/planka/.well-known/openid-configuration.And also make sure the
nameandemailfields exist in the preview:Providers -> Select provider -> Preview
@SangeloDev commented on GitHub (Oct 23, 2023):
Yes, the scopes are present and active
@meltyshev commented on GitHub (Oct 23, 2023):
Hm... Then that's very strange. Can you show the response of the request to https://plank.example.com/api/access-tokens/exchange-using-oidc, is there
Unable to retrieve required values (email, name)? You can check this by opening the Browser console (F12) -> Network.@SangeloDev commented on GitHub (Oct 24, 2023):
The network tab seems to look fine on this page, except for a 404 code for logo192.png, which seems irrelevant.
The console also only reports this 404 error for the logo. Everything else seems ok.
The page looks like this when I visit it:

I believe/hope this is normal behaviour for this page
@meltyshev commented on GitHub (Oct 24, 2023):
Sorry, I didn't clarify well how it has to be done. Please open Network and click "Login in with SSO" button. When the error is displayed, click the
POST exchange-using-oidcline in Network. There should be a preview of the result somewhere (probably "Preview" button) and the error text will be there.@SangeloDev commented on GitHub (Oct 24, 2023):
No problem, thanks for clarifying! Yes, I do get this response:

@meltyshev commented on GitHub (Oct 24, 2023):
I don't understand why
nameoremailcan be missing if everything is configured correctly...Could you please provide
authorizationUrlwhich is located in theGET configline in Network (you can erase all parts you don't want to show). Or just make sure that thescope=parameter containsopenid email profile.@SangeloDev commented on GitHub (Oct 24, 2023):
They seem to be included, yes
@meltyshev commented on GitHub (Oct 24, 2023):
I can't understand what could be the problem 🙈 Everything seems to be configured correctly. I've tested OIDC through Authentik many times and never had a problem, also checked the code many times and it's definitely because Authentik doesn't return a name or email when requesting userinfo. Maybe there is something wrong with Authentik itself or just some setting missing. I'll try to google a similar problem...
@SangeloDev commented on GitHub (Oct 24, 2023):
Could it be a more underlying problem? Anything I might've misconfigured at e.g. the reverse proxy level? Or possibly deeper?
@meltyshev commented on GitHub (Oct 24, 2023):
I've checked in the code that the exchange with Authentik is correct, otherwise there will be an
Invalid code or nonceerror.The error occurs in this place:
So Authentik responded correctly, but for some reason there is no
emailornamein the response...Let's try to check what is in the response by adding logging.
You need to change the
docker-compose.ymland replace:to this:
Then start the container and connect to it (
planka-planka-1is its name):Then add logging and start the server:
The console will display a response coming from Authentik when an error occurs. We can figure out what's missing from it.
@SangeloDev commented on GitHub (Oct 24, 2023):
The line after
debug:is what I get when logging in with Authentik.@meltyshev commented on GitHub (Oct 24, 2023):
Sorry, my bad 🙈 Please execute:
Then repeat the whole process (I fixed one command in the previous comment).
@SangeloDev commented on GitHub (Oct 24, 2023):
Aha! This time there's more:
It seems like Planka gets all the required info? Tell me if you need anything else
@meltyshev commented on GitHub (Oct 24, 2023):
Hm, for some reason
emailis blank, but it's required to create an account in Planka. Is it filled out in Authentik?@SangeloDev commented on GitHub (Oct 24, 2023):
Okay! That worked! Thanks a bunch! 🎉
I currently don't have a mail server set up, which is why I didn't think of that. This is all on me, thanks again for helping and being quick to answer!
Just one more thing, after logging in, I can't seem to create any boards and projects. Where can I configure user permissions if I need to?
@meltyshev commented on GitHub (Oct 24, 2023):
That's great!
If you are using OIDC, you need to specify the correct admin group in
OIDC_ADMIN_ROLES. I see that you have 2 roles["authentik-private", "authentik-users"], so most likely you need to makeOIDC_ADMIN_ROLES=authentik-private.You can also create an administrator account without using OIDC, you can do this via
DEFAULT_ADMIN_*variables.@SangeloDev commented on GitHub (Oct 24, 2023):
Ah, so all users who need to be able to create boards need to be admins if I understand correctly?
I just don't want any users who may get access to Planka to create any users that are not authenticated using Authentik, aka local users.
@meltyshev commented on GitHub (Oct 25, 2023):
They have to be administrators just to create a project. So, any user can be assigned as a project manager (in the project settings) and then this user can create boards in it. We have plans to add the ability to create projects for non-admin users (if they are allowed to do so in the settings). Unfortunately there is no way to completely remove the creation of local users yet, but it's a good idea to add that.
@SangeloDev commented on GitHub (Oct 25, 2023):
Should I create a separate issue with a feature suggestion for that, then?
@meltyshev commented on GitHub (Oct 25, 2023):
Yeah, that's a good idea, I'll add the Enhancement label to it.
@SangeloDev commented on GitHub (Oct 25, 2023):
I have created a new issue here:
https://github.com/plankanban/planka/issues/532
Thanks a ton for your help and kindness, I greatly appreciate it!