-
-
Notifications
You must be signed in to change notification settings - Fork 254
feat(openid): add emailclaim config for custom user identifier #1943
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
base: main
Are you sure you want to change the base?
feat(openid): add emailclaim config for custom user identifier #1943
Conversation
Add configuration option to specify an alternative claim to use as the user's email address. This is useful for environments like Azure AD where the standard email claim may not be available or configurable per-app. The emailclaim option can be set to use claims like 'upn' (User Principal Name) or any other claim containing a unique identifier in email format.
|
I run an organization that uses a free tier Azure AD/Entra ID tenant. Not everybody has the Vikunja requires the I cannot modify the So, I (with the assistance of Claude Opus 4.5 via GitHub Copilot CLI) added a new option to the OpenID auth provider config: In my deployment, I've set I'm not married to the name I'll also note that I'm not a Go developer by day, and Copilot (via Opus) did most of the heavy lifting. |
| } | ||
|
|
||
| // TestExtractCustomEmailClaim tests extracting email from a custom claim | ||
| func TestExtractCustomEmailClaim(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests just duplicate the logic in the test and are therefore not very useful since they don't test the actual logic. Please modify them accordingly.
| { | ||
| "key": "emailclaim", | ||
| "default_value": "", | ||
| "comment": "This option allows specifying an alternative claim to use as the user's email address. By default, Vikunja uses the standard `email` claim. In environments like Azure AD where users may not have email addresses configured or the email claim cannot be modified per-app, you can set this to use a different claim such as `upn` (User Principal Name) or any other claim that contains a unique identifier in email format. The claim value should be a valid email-like string that can be used to identify the user." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "comment": "This option allows specifying an alternative claim to use as the user's email address. By default, Vikunja uses the standard `email` claim. In environments like Azure AD where users may not have email addresses configured or the email claim cannot be modified per-app, you can set this to use a different claim such as `upn` (User Principal Name) or any other claim that contains a unique identifier in email format. The claim value should be a valid email-like string that can be used to identify the user." | |
| "comment": "This option allows specifying an alternative claim to use as the user's email address if the default claim is empty or not present. By default, Vikunja uses the standard `email` claim. In environments like Azure AD where users may not have email addresses configured or the email claim cannot be modified per-app, you can set this to use a different claim such as `upn` (User Principal Name) or any other claim that contains a unique identifier in email format. The claim value should be a valid email-like string that can be used to identify the user." |
Add
emailclaimconfiguration option to openid auth providers to specify an alternative claim to use as the user's email address. This is useful for environments like Azure AD where the standard email claim may not be available or configurable per-app.The emailclaim option can be set to use claims like 'upn' (User Principal Name) or any other claim containing a unique identifier in email format.