mirror of
https://github.com/plankanban/planka.git
synced 2025-12-06 09:13:16 +03:00
OIDC username validation failure #442
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 @agent-squirrel on GitHub.
Hi
I've just started using Planka for a project and it's really great, thank you for your hard work.
Our team has one issue when logging in with OIDC. We use authentik as the IDP and currently usernames have no constraints so some team members used a name and others used an email.
The users with email usernames fail to login to Planka because of a maximum username length constraint violation. Is this a configurable option or do you have any idea how to mitigate this?
I've redacted the proper email address.
@AlGoCo commented on GitHub:
hi,
I have the same problem with zitadel as OIDC... just a bit more intense because zitadel uses as default the email as username...
can i change the username regex and length rule somewehre manualy or disable username for OIDC auth at all?
just if you know directly where i can change it otherwise I will look by my self.
lg
@meltyshev commented on GitHub:
Hi! We recently added OIDC and there are still some issues that need to be solved. I was thinking of adding environment variables through which you can set which OIDC fields to use to create an account. For example, in this case you can skip setting a username at all, as it's optional in Planka.
@IndiGP commented on GitHub:
Hi,
little bit offtopic, but I configured OIDC, but where can I login? I only get the normal Userform for login, but no button for Authentik authentication. Running in docker. Trying to login with credentials from Authentik will end up in "Invalid email or username: ".
Thank you!
@agent-squirrel commented on GitHub:
Sounds good. For now we will just work around the issue but good to hear things are on the roadmap. Thanks.
@meltyshev commented on GitHub:
Hi! Sorry for the late reply.
To not use username during OIDC auth you need to comment line 62 in
server/api/helpers/users/get-or-create-one-using-oidc.js:We are planning to add the ability to specify which fields to use, so you can easily change this without changing the code.
@IndiGP commented on GitHub:
I am getting Json Response like:
{
"item": {
OIDC: 0
}
}
..
@meltyshev commented on GitHub:
It looks like Planka doesn't see your environment variables with OIDC settings and that's weird. Please try to connect to the container and print the
OIDC_ISSUERvariable viadocker exec -t planka-planka-1 echo $OIDC_ISSUER(the container name may be different). You can also try deleting the container completely and creating it again (don't forget to save all the data before doing it).@IndiGP commented on GitHub:
Hi, thank you for reply!
Server ist running in docker container with docker compose file and postgres. Restarting it via docker compose down and up.
Currently OICD in compose file looks like this:
- OIDC_ISSUER=https://auth.domain.de/application/o/planka/
- OIDC_CLIENT_ID= #short key
- OIDC_CLIENT_SECRET= #long key
- OIDC_SCOPES=openid email profile
- OIDC_ADMIN_ROLES=docker
- OIDC_ROLES_ATTRIBUTE=groups
# - OIDC_IGNORE_ROLES=true
If you need different information, please mention :)
@meltyshev commented on GitHub:
Hmm, it looks just as it should...
Are you sure you are using the latest Planka image (where OIDC was added)?
Please try to check
/api/configendpoint (for example: https://planka.url/api/config where https://planka.url is your BASE_URL). The response should be something like this:@meltyshev commented on GitHub:
Hi! The
Login with SSObutton should appear as soon as you specify theOIDC_*environment variables and restart the server. It seems like you changed variables in the wrong place or forgot to restart the server. We need more information about your way of running Planka to help find the problem.@IndiGP commented on GitHub:
Oh my gosh... you are totaly right, there was an space to much in docker yaml, why the variables were not read.. Thank you for helping so fast!