From afafc64e58da0c693fd5fafe0edb06c81414a504 Mon Sep 17 00:00:00 2001 From: hybrid2102 Date: Fri, 10 Nov 2023 11:37:12 +0100 Subject: [PATCH] added Scope mapping in RefreshAccessTokenAsync --- .../UserTokenEndpointService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Duende.AccessTokenManagement.OpenIdConnect/UserTokenEndpointService.cs b/src/Duende.AccessTokenManagement.OpenIdConnect/UserTokenEndpointService.cs index 47037e4..f0173b4 100755 --- a/src/Duende.AccessTokenManagement.OpenIdConnect/UserTokenEndpointService.cs +++ b/src/Duende.AccessTokenManagement.OpenIdConnect/UserTokenEndpointService.cs @@ -69,7 +69,12 @@ public async Task RefreshAccessTokenAsync( }; request.Options.TryAdd(ClientCredentialsTokenManagementDefaults.TokenRequestParametersOptionsName, parameters); - + + if (!string.IsNullOrWhiteSpace(parameters.Scope)) + { + request.Scope = parameters.Scope; + } + if (!string.IsNullOrEmpty(parameters.Resource)) { request.Resource.Add(parameters.Resource);