Skip to content

Commit

Permalink
Fix for empty scopes. HasScopes does return true when empty scopes ar…
Browse files Browse the repository at this point in the history
…e passed (#3677)

* fix for empty scopes. HasScopes does return true when empty scopes are passed

* null check

Co-authored-by: Gladwin Johnson <[email protected]>
  • Loading branch information
gladjohn and GladwinJohnson authored Sep 16, 2022
1 parent 75de81e commit 8d9786b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client/Microsoft.Identity.Client.Broker/WamAdapters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,9 @@ public static void ValidateAuthParams(
{
//MSAL Runtime throws an ApiContractViolation Exception with Tag: 0x2039c1cb (InvalidArg)
//When no scopes are passed, this will check if user is passing scopes
if (!authenticationRequestParameters.HasScopes)
var scopes = authenticationRequestParameters.Scope?.ElementAtOrDefault(0);

if (string.IsNullOrWhiteSpace(scopes))
{
logger.Error($"[WamBroker] {MsalError.WamScopesRequired} " +
$"{MsalErrorMessage.ScopesRequired}");
Expand Down

0 comments on commit 8d9786b

Please sign in to comment.