From 1b39d71921be20df43e87e97a3f55c718789f49e Mon Sep 17 00:00:00 2001 From: Livio Spring Date: Tue, 17 Sep 2024 14:18:29 +0200 Subject: [PATCH] fix: user grants deactivation (#8634) # Which Problems Are Solved ZITADEL's user grants deactivation mechanism did not work correctly. Deactivated user grants were still provided in token, which could lead to unauthorized access to applications and resources. Additionally, the management and auth API always returned the state as active or did not provide any information about the state. # How the Problems Are Solved - Correctly check the user grant state on active for tokens and user information (userinfo, introspection, saml attributes) - Map state in API and display in Console (cherry picked from commit ca1914e235df8eb62189cec07eb0de2cdad29629) --- .../user-grants/user-grants.component.html | 17 ++++++++++++++++- .../user-grants/user-grants.component.ts | 10 +++++++++- .../src/app/pages/grants/grants.component.html | 1 + .../granted-project-detail.component.html | 11 ++++++++++- .../owned-project-detail.component.html | 2 +- .../auth-user-detail.component.html | 11 ++++++++++- .../user-detail/user-detail.component.html | 2 +- internal/api/grpc/auth/user_grant.go | 1 + internal/api/grpc/user/user_grant.go | 17 ++++++++++++++++- internal/api/oidc/client.go | 13 +++++++++---- internal/api/saml/storage.go | 5 +++++ .../auth/repository/eventsourcing/repository.go | 7 ++++++- internal/query/user_grant.go | 4 ++++ internal/query/userinfo_by_id.sql | 1 + proto/zitadel/auth.proto | 5 +++++ 15 files changed, 95 insertions(+), 12 deletions(-) diff --git a/console/src/app/modules/user-grants/user-grants.component.html b/console/src/app/modules/user-grants/user-grants.component.html index efca9f74ec..82de67c8bb 100644 --- a/console/src/app/modules/user-grants/user-grants.component.html +++ b/console/src/app/modules/user-grants/user-grants.component.html @@ -154,10 +154,25 @@ + + {{ 'PROJECT.GRANT.STATE' | translate }} + + + {{ 'USER.DATA.STATE' + grant.state | translate }} + + + + - +