zitadel/internal/api
Tim Möhlmann 3b140a67c8
fix(oidc): always set sub claim (#8598)
# Which Problems Are Solved

When the `openid` scope was not requested, as is possible in machine
authentication, we didn't set the `sub` (subject) claim to tokens and
possibly also userInfo and introspection.

This fix always sets the `sub` claim for all cases.

# How the Problems Are Solved

Set the `Subject` field to regardless of passed scopes.

# Additional Changes

- none

# Additional Context

According to standards:

- [RFC9068 - JSON Web Token (JWT) Profile for OAuth 2.0 Access
Tokens](https://datatracker.ietf.org/doc/html/rfc9068#name-data-structure)
this claim is **required**.
- [RFC7667 - OAuth 2.0 Token
Introspection](https://datatracker.ietf.org/doc/html/rfc7662#section-2.2)
the claim is optional, however there is no correlation to the `openid`
or OpenID Connect. Therefore it doesn't harm to always return this
claim.
- [OpenID connect, User Info
Response](https://openid.net/specs/openid-connect-core-1_0.html#UserInfoResponse):
"The sub (subject) Claim **MUST** always be returned in the UserInfo
Response."

Closes https://github.com/zitadel/zitadel/issues/8591
2024-09-12 12:36:33 +00:00
..
assets feat: trusted (instance) domains (#8369) 2024-07-31 18:00:38 +03:00
authz feat(v3alpha): read actions (#8357) 2024-08-12 22:32:01 +02:00
call fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
grpc feat: add http as smtp provider (#8545) 2024-09-12 06:27:29 +02:00
http feat(oidc): use web keys for token signing and verification (#8449) 2024-08-23 14:43:46 +02:00
idp chore(tests): use a coverage server binary (#8407) 2024-09-06 14:47:57 +02:00
info fix: correct method and path for session api activity (#6880) 2023-11-22 12:12:23 +02:00
oidc fix(oidc): always set sub claim (#8598) 2024-09-12 12:36:33 +00:00
robots_txt fix: introduce measures to avoid bots crawling and indexing activities (#5728) 2023-05-05 10:25:02 +02:00
saml fix(eventstore): precise decimal (#8527) 2024-09-06 12:19:19 +03:00
service fix(eventstore): tests 2020-11-26 09:19:14 +01:00
ui feat: invite user link (#8578) 2024-09-11 10:53:55 +00:00
api.go feat: trusted (instance) domains (#8369) 2024-07-31 18:00:38 +03:00