zitadel/internal/integration
Livio Spring f065b42a97
fix(oidc): respect role assertion and idTokenInfo flags and trigger preAccessToken trigger (#8046)
# Which Problems Are Solved

After deployment of 2.53.x, customers noted that the roles claims where
always present in the tokens even if the corresponding option on the
client (accessTokenRoleAssertion, idTokenRoleAsseriton) was disabled.
Only the project flag (assertRolesOnAuthentication) would be considered.

Further it was noted, that the action on the preAccessTokenCreation
trigger would not be executed.

Additionally, while testing those issues we found out, that the user
information (name, givenname, family name, ...) where always present in
the id_token even if the option (idTokenUserInfo) was not enabled.

# How the Problems Are Solved

- The `getUserinfoOnce` which was used for access and id_tokens is
refactored to `getUserInfo` and no longer only queries the info once
from the database, but still provides a mechanism to be reused for
access and id_token where the corresponding `roleAssertion` and action
`triggerType` can be passed.
- `userInfo` on the other hand now directly makes sure the information
is only queried once from the database. Role claims are asserted every
time and action triggers are executed on every call.
- `userInfo` now also checks if the profile information need to be
returned.

# Additional Changes

None.

# Additional Context

- relates to #7822 
- reported by customers
2024-05-31 10:10:18 +00:00
..
config test(e2e): fix events flakiness (#7829) 2024-04-23 09:20:11 +02:00
assert_test.go feat: impersonation roles (#7442) 2024-02-28 10:21:11 +00:00
assert.go feat: add action v2 execution on requests and responses (#7637) 2024-05-04 11:55:57 +02:00
client.go feat(saml): allow setting nameid-format and alternative mapping for transient format (#7979) 2024-05-23 05:04:07 +00:00
integration_test.go AddHumanUser tests 2023-04-28 14:39:53 +03:00
integration.go feat: query side for executions and targets for actions v2 (#7524) 2024-03-14 09:56:23 +00:00
oidc.go fix(oidc): respect role assertion and idTokenInfo flags and trigger preAccessToken trigger (#8046) 2024-05-31 10:10:18 +00:00
rand.go feat: restrict languages (#6931) 2023-12-05 11:12:01 +00:00
user.go feat(oidc): token exchange impersonation (#7516) 2024-03-20 10:18:46 +00:00
usertype_string.go feat(api): add organisation service (#6340) 2023-08-11 14:19:14 +00:00