zitadel/internal/api
Tim Möhlmann 9ccbbe05bc
fix(oidc): roles in userinfo for client credentials token (#7763)
* fix(oidc): roles in userinfo for client credentials token

When tokens were obtained using the client credentials grant,
with audience and role scopes, userinfo would not return the role claims. This had multiple causes:

1. There is no auth request flow, so for legacy userinfo project data was never attached to the token
2. For optimized userinfo, there is no client ID that maps to an application. The client ID for client credentials is the machine user's name. There we can't obtain a project ID. When the project ID remained empty, we always ignored the roleAudience.

This PR fixes situation 2, by always taking the roleAudience into account, even when the projectID is empty. The code responsible for the bug is also refactored to be more readable and understandable, including additional godoc.

The fix only applies to the optimized userinfo code introduced in #7706 and released in v2.50 (currently in RC). Therefore it can't be back-ported to earlier versions.

Fixes #6662

* chore(deps): update all go deps (#7764)

This change updates all go modules, including oidc, a major version of go-jose and the go 1.22 release.

* Revert "chore(deps): update all go deps" (#7772)

Revert "chore(deps): update all go deps (#7764)"

This reverts commit 6893e7d060.

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
2024-04-16 13:02:38 +00:00
..
assets fix: detect mime type of uploaded asset (#7648) 2024-03-27 10:41:10 +01:00
authz chore(deps): update all go deps (#7773) 2024-04-15 09:17:36 +00:00
call fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
grpc feat: SMTP Templates (#6932) 2024-04-11 09:16:10 +02:00
http refactor(fmt): run gci on complete project (#7557) 2024-04-03 10:43:43 +00:00
idp chore(ci): merge test runs (#7388) 2024-02-19 07:50:37 +01:00
info fix: correct method and path for session api activity (#6880) 2023-11-22 12:12:23 +02:00
oidc fix(oidc): roles in userinfo for client credentials token (#7763) 2024-04-16 13:02:38 +00:00
robots_txt fix: introduce measures to avoid bots crawling and indexing activities (#5728) 2023-05-05 10:25:02 +02:00
saml chore(deps): update all go deps (#7773) 2024-04-15 09:17:36 +00:00
service fix(eventstore): tests 2020-11-26 09:19:14 +01:00
ui feat(idp): provide option to auto link user (#7734) 2024-04-10 15:46:30 +00:00
api.go feat: improve instance not found error (#7413) 2024-02-28 10:49:57 +00:00