mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-25 04:15:36 -04:00
[GH-ISSUE #223] Failed to sign in: "Invalid username claim in OIDC response: preferred_username". #114
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 @mattiaginoble on GitHub (Aug 30, 2025).
Original GitHub issue: https://github.com/Drop-OSS/drop/issues/223
I just added OIDC login via Cloudflare and my Google account (same email as the account I already created during the initial setup), but I'm getting this error. Did I enter the environment variables incorrectly? Thanks
I have included everything that was in the documentation at Doc
I have not included:
OIDC_ADMIN_GROUP
OIDC_WELLKNOWN
@DecDuck commented on GitHub (Aug 30, 2025):
The default OIDC_USERNAME_CLAIM is designed for Authentik, if you're not using that, you'll have to set it.
@mattiaginoble commented on GitHub (Aug 31, 2025):
Thanks for your reply. I'm not using Authentik, but I am using Cloudflare Zero Trust for all my containers. Will support for this be added?
@DecDuck commented on GitHub (Aug 31, 2025):
Can you try using
OIDC_USERNAME_CLAIM=oidc_fields.preferred_username?@mattiaginoble commented on GitHub (Sep 1, 2025):
Added
OIDC_USERNAME_CLAIM=oidc_fields.preferred_usernameto the environment variables, but I always get the same error.I tried to add
OIDC_USERNAME_CLAIM=email, it works now.It created a new account for me with my Google email address (the same email address I used previously).
@DecDuck commented on GitHub (Sep 2, 2025):
Alright, glad you got it working. I'll have to look more into how to actually get the username field from Cloudflare though.
@mattiaginoble commented on GitHub (Sep 2, 2025):
Thanks to you, it's a great project anyway, you've made a lot of progress.
@InsertDisc commented on GitHub (Oct 23, 2025):
If OIDC_USERNME_CLAIM=email worked then what are the chances OIDC_USERNME_CLAIM=preferred_username would work since those two are at the same level in the token?
@DecDuck commented on GitHub (Oct 23, 2025):
I mean, try it and see. I believe that's the default but it's been a while since I wrote the OIDC code.
Failed to sign in: "Invalid username claim in OIDC response: preferred_username".to [GH-ISSUE #223] Failed to sign in: "Invalid username claim in OIDC response: preferred_username".@TigerC10 commented on GitHub (Jun 7, 2026):
The Google oauth IdP doesn't return a preferred_username claim, so Cloudflare OIDC can't include it.