[openstreetmap/openstreetmap-website] Include preferred_username claim in OIDC ID token (PR #6429)

ENT8R notifications at github.com
Mon Oct 6 18:59:29 UTC 2025


@ENT8R commented on this pull request.



> @@ -110,7 +110,7 @@ def test_openid_connect
     end
 
     assert_equal user.id.to_s, data["sub"]
-    assert_not data.key?("preferred_username")

I was also confused why the preferred_username is not in the id token but apparently all custom claims defined in the configuration are only returned by the userinfo endpoint and not added to the id token, if not specified explicitly otherwise:
> By default all custom claims are only returned from the UserInfo endpoint and not included in the ID token. You can optionally pass a response: keyword with one or both of the symbols :id_token or :user_info to specify where the claim should be returned.

<sup><i>https://github.com/doorkeeper-gem/doorkeeper-openid_connect#claims</i></sup>

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6429#discussion_r2408011448
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6429/review/3306670299 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251006/a1f91ec7/attachment.htm>


More information about the rails-dev mailing list