diff --git a/OpenHarbor.JwtTokenManager/JwtTokenManagerService.cs b/OpenHarbor.JwtTokenManager/JwtTokenManagerService.cs index f400758..d6b919c 100644 --- a/OpenHarbor.JwtTokenManager/JwtTokenManagerService.cs +++ b/OpenHarbor.JwtTokenManager/JwtTokenManagerService.cs @@ -31,7 +31,7 @@ public class JwtTokenManagerService(JwtTokenManagerOptions options, IHttpClientF new ("scopes", string.Join(" ", _scopes)) }; - if (options.IsCredentialsInHeader) + if (false == options.IsCredentialsInHeader) { formContentKeyValues.AddRange([ new KeyValuePair("client_id", options.ClientId), @@ -45,8 +45,9 @@ public class JwtTokenManagerService(JwtTokenManagerOptions options, IHttpClientF Content = formContent }; - if (false == options.IsCredentialsInHeader) + if (options.IsCredentialsInHeader) { + var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{options.ClientId}:{options.ClientSecret}")); request.Headers.Authorization = new AuthenticationHeaderValue("Basic", credentials); }