diff --git a/src/client/Microsoft.Identity.Client/Internal/Requests/DeviceCodeRequest.cs b/src/client/Microsoft.Identity.Client/Internal/Requests/DeviceCodeRequest.cs index 8a9a7460ef..39fb9cb48a 100644 --- a/src/client/Microsoft.Identity.Client/Internal/Requests/DeviceCodeRequest.cs +++ b/src/client/Microsoft.Identity.Client/Internal/Requests/DeviceCodeRequest.cs @@ -31,11 +31,8 @@ protected override async Task ExecuteAsync(CancellationTok var client = new OAuth2Client(ServiceBundle.ApplicationLogger, ServiceBundle.HttpManager, null); - var deviceCodeScopes = new HashSet(); - deviceCodeScopes.UnionWith(AuthenticationRequestParameters.Scope); - deviceCodeScopes.Add(OAuth2Value.ScopeOfflineAccess); - deviceCodeScopes.Add(OAuth2Value.ScopeProfile); - deviceCodeScopes.Add(OAuth2Value.ScopeOpenId); + var deviceCodeScopes = new HashSet(AuthenticationRequestParameters.Scope); + deviceCodeScopes.UnionWith(OAuth2Value.ReservedScopes); client.AddBodyParameter(OAuth2Parameter.ClientId, AuthenticationRequestParameters.AppConfig.ClientId); client.AddBodyParameter(OAuth2Parameter.Scope, deviceCodeScopes.AsSingleString()); diff --git a/src/client/Microsoft.Identity.Client/Internal/Requests/UsernamePasswordRequest.cs b/src/client/Microsoft.Identity.Client/Internal/Requests/UsernamePasswordRequest.cs index 1b049b6223..fc50f61f4d 100644 --- a/src/client/Microsoft.Identity.Client/Internal/Requests/UsernamePasswordRequest.cs +++ b/src/client/Microsoft.Identity.Client/Internal/Requests/UsernamePasswordRequest.cs @@ -187,14 +187,9 @@ private Dictionary GetAdditionalBodyParameters(UserAssertion use dict[OAuth2Parameter.Password] = _usernamePasswordParameters.Password; } - ISet unionScope = new HashSet() - { - OAuth2Value.ScopeOpenId, - OAuth2Value.ScopeOfflineAccess, - OAuth2Value.ScopeProfile - }; + var unionScope = new HashSet(AuthenticationRequestParameters.Scope); + unionScope.UnionWith(OAuth2Value.ReservedScopes); - unionScope.UnionWith(AuthenticationRequestParameters.Scope); dict[OAuth2Parameter.Scope] = unionScope.AsSingleString(); dict[OAuth2Parameter.ClientInfo] = "1";