zitadel/internal
Tim Möhlmann f5e9d4f57f
fix(oidc): IDP and machine user auth methods (#7992)
# Which Problems Are Solved

After https://github.com/zitadel/zitadel/pull/7822 was merged we
discovered that
v2 tokens that where obtained through an IDP using the v1 login, can't
be used for
zitadel API calls.

- Because we used to store the AMR claim on the auth request, but
internally use the domain.UserAuthMethod type. AMR has no notion of an
IDP login, so that "factor" was lost
during conversion. Rendering those v2 tokens invalid on the zitadel API.
- A wrong check on machine user tokens falsly allowed some tokens to be
valid
- The client ID was set to tokens from client credentials and JWT
profile, which made client queries fail in the validation middleware.
The middleware expects client ID unset for machine users.

# How the Problems Are Solved

Store the domain.AuthMethods directly in  the auth requests and session,
instead of using AMR claims with lossy conversion.

- IDPs have seperate auth method, which is not an AMR claim
- Machine users are treated specialy, eg auth methods are not required.
- Do not set the client ID for client credentials and JWT profile

# Additional Changes

Cleaned up mostly unused `oidc.getInfoFromRequest()`.

# Additional Context

- Bugs were introduced in https://github.com/zitadel/zitadel/pull/7822
and not yet part of a release.
- Reported internally.
2024-05-23 05:35:10 +00:00
..
actions feat(actions): allow getting metadata of organizations from user grants (#7782) 2024-04-22 11:34:23 +00:00
activity fix: get orgID when missing on trigger logs (#7555) 2024-03-14 08:49:10 +00:00
admin/repository/eventsourcing fix(setup): init projections (#7194) 2024-01-25 17:28:20 +01:00
api fix(oidc): IDP and machine user auth methods (#7992) 2024-05-23 05:35:10 +00:00
auth/repository fix(oidc): IDP and machine user auth methods (#7992) 2024-05-23 05:35:10 +00:00
auth_request/repository fix(login): correctly reload policies on auth request (#7839) 2024-04-24 08:44:55 +00:00
authz fix(oidc): IDP and machine user auth methods (#7992) 2024-05-23 05:35:10 +00:00
command feat(saml): allow setting nameid-format and alternative mapping for transient format (#7979) 2024-05-23 05:04:07 +00:00
config feat(crypto): use passwap for machine and app secrets (#7657) 2024-04-05 09:35:49 +00:00
crypto feat(crypto): use passwap for machine and app secrets (#7657) 2024-04-05 09:35:49 +00:00
database perf: cache auth request in memory (#7824) 2024-04-23 11:23:50 +00:00
domain fix(oidc): IDP and machine user auth methods (#7992) 2024-05-23 05:35:10 +00:00
eventstore fix(login): improve auth handlers (#7969) 2024-05-22 15:26:02 +00:00
execution feat: add action v2 execution on requests and responses (#7637) 2024-05-04 11:55:57 +02:00
feature fix: add action v2 execution to features (#7597) 2024-04-09 20:21:21 +03:00
form refactor: rename package errors to zerrors (#7039) 2023-12-08 15:30:55 +01:00
i18n fix(middleware): init translation messages (#7778) 2024-04-16 12:08:18 +00:00
iam refactor: cleanup unused code (#7130) 2024-01-02 14:26:31 +00:00
id fix: add action v2 execution to features (#7597) 2024-04-09 20:21:21 +03:00
idp feat(saml): allow setting nameid-format and alternative mapping for transient format (#7979) 2024-05-23 05:04:07 +00:00
integration feat(saml): allow setting nameid-format and alternative mapping for transient format (#7979) 2024-05-23 05:04:07 +00:00
logstore perf: project quotas and usages (#6441) 2023-09-15 16:58:45 +02:00
migration fix(setup): init projections (#7194) 2024-01-25 17:28:20 +01:00
net perf: project quotas and usages (#6441) 2023-09-15 16:58:45 +02:00
notification fix: Update fr translations (#7910) 2024-05-17 13:16:55 +02:00
org refactor: cleanup unused code (#7130) 2024-01-02 14:26:31 +00:00
project refactor: cleanup unused code (#7130) 2024-01-02 14:26:31 +00:00
protoc merge main into next 2023-10-19 12:34:00 +02:00
qrcode docs(legal): Updated agreements and policies v2 (#3823) 2022-06-15 08:30:58 +02:00
query fix(oidc): IDP and machine user auth methods (#7992) 2024-05-23 05:35:10 +00:00
renderer fix(login): (re)allow HTML in custom login texts (#7575) 2024-03-15 16:29:10 +01:00
repository feat(saml): allow setting nameid-format and alternative mapping for transient format (#7979) 2024-05-23 05:04:07 +00:00
static feat(saml): allow setting nameid-format and alternative mapping for transient format (#7979) 2024-05-23 05:04:07 +00:00
statik chore: initial version of a devcontainer (#6352) 2023-08-15 10:49:05 +02:00
telemetry refactor(fmt): run gci on complete project (#7557) 2024-04-03 10:43:43 +00:00
test refactor(fmt): run gci on complete project (#7557) 2024-04-03 10:43:43 +00:00
user fix(login): improve auth handlers (#7969) 2024-05-22 15:26:02 +00:00
v2 refactor(v2): init events (#7823) 2024-05-23 06:36:08 +02:00
view/repository refactor(fmt): run gci on complete project (#7557) 2024-04-03 10:43:43 +00:00
webauthn fix: allow other users to set up MFAs (#7914) 2024-05-07 05:38:26 +00:00
zerrors refactor(fmt): run gci on complete project (#7557) 2024-04-03 10:43:43 +00:00