mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-03-09 07:13:35 -05:00
[PR #797] [MERGED] feat(auth): add ForceUserInfo option to OpenID provider #951
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?
📋 Pull Request Information
Original PR: https://github.com/go-vikunja/vikunja/pull/797
Author: @maggch97
Created: 5/19/2025
Status: ✅ Merged
Merged: 5/20/2025
Merged by: @kolaente
Base:
main← Head:user/weijiezhao/forceUserInfo📝 Commits (4)
d0c4f1cfeat(auth): add ForceUserInfo option to OpenID provider4c1e5a9Add unit test for ForceUserInfoc685639Merge branch 'main' into user/weijiezhao/forceUserInfoe2029c7Remove provideName param📊 Changes
4 files changed (+177 additions, -19 deletions)
View changed files
📝
config-raw.json(+5 -0)📝
pkg/modules/auth/openid/openid.go(+34 -19)📝
pkg/modules/auth/openid/openid_test.go(+124 -0)📝
pkg/modules/auth/openid/providers.go(+14 -0)📄 Description
Add ForceUserInfo option to OpenID provider
Problem
When using Casdoor as an OpenID provider, there's an inconsistency between the user information in the JWT token and the UserInfo endpoint. The token contains the user's unique ID in the
namefield, while the UserInfo endpoint correctly returns the user's display name.Solution
This PR adds a new
ForceUserInfooption to the OpenID provider configuration. When enabled, it forces the use of the UserInfo endpoint to retrieve user information instead of relying on claims from the ID token.Impact
Related
I've opened an issue in the Casdoor repository (https://github.com/casdoor/casdoor/issues/3806) to discuss the root cause. However, changing Casdoor's token structure might cause significant compatibility issues for existing integrations, so it's unclear if this can be fixed at the provider level. This PR provides a workaround in Vikunja that doesn't affect existing functionality.
Docs PR: https://github.com/go-vikunja/website/pull/107
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.