From 9d813de0fdf6ae710ae394d361ee7303149b768e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Schwartz?= <40674593+3schwartz@users.noreply.github.com> Date: Mon, 18 Nov 2024 10:38:16 +0100 Subject: [PATCH] add request scopes to webhook request --- oauth2/token_hook.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/oauth2/token_hook.go b/oauth2/token_hook.go index d32cadd7e4d..1dc2ee46700 100644 --- a/oauth2/token_hook.go +++ b/oauth2/token_hook.go @@ -30,6 +30,8 @@ type AccessRequestHook func(ctx context.Context, requester fosite.AccessRequeste type Request struct { // ClientID is the identifier of the OAuth 2.0 client. ClientID string `json:"client_id"` + // RequestedScopes is the list of scopes requested to the OAuth 2.0 client. + RequestedScopes []string `json:"requested_scopes"` // GrantedScopes is the list of scopes granted to the OAuth 2.0 client. GrantedScopes []string `json:"granted_scopes"` // GrantedAudience is the list of audiences granted to the OAuth 2.0 client. @@ -168,6 +170,7 @@ func TokenHook(reg interface { request := Request{ ClientID: requester.GetClient().GetID(), + RequestedScopes: requester.GetRequestedScopes(), GrantedScopes: requester.GetGrantedScopes(), GrantedAudience: requester.GetGrantedAudience(), GrantTypes: requester.GetGrantTypes(),