Skip to content

Commit

Permalink
Taking Jenny's feedback into account
Browse files Browse the repository at this point in the history
  • Loading branch information
jmprieur committed Sep 12, 2019
1 parent f001102 commit d9c3bff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

// The same code for the controller is used in both chapters of the tutorial.
// In the first chapter this is just a protected API (ENABLE_OBO is not set)
// In this chapter, the Web API calls a downstream API on behalf of the user (OBO)
#define ENABLE_OBO
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
Expand Down
4 changes: 2 additions & 2 deletions Microsoft.Identity.Web/Client/TokenAcquisition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ public void ReplyForbiddenWithWwwAuthenticateHeader(HttpContext httpContext, IEn
string proposedAction = "consent";
if (msalServiceException.ErrorCode == MsalError.InvalidGrantError)
{
if (AcceptedTokenVersionIsNotTheSameAsTokenVersion(msalServiceException))
if (AcceptedTokenVersionMismatch(msalServiceException))
{
throw msalServiceException;
}
Expand Down Expand Up @@ -473,7 +473,7 @@ public void ReplyForbiddenWithWwwAuthenticateHeader(HttpContext httpContext, IEn
headers.Add(HeaderNames.WWWAuthenticate, v);
}

private static bool AcceptedTokenVersionIsNotTheSameAsTokenVersion(MsalUiRequiredException msalSeviceException)
private static bool AcceptedTokenVersionMismatch(MsalUiRequiredException msalSeviceException)
{
// Normally app developers should not make decisions based on the internal AAD code
// however until the STS sends sub-error codes for this error, this is the only
Expand Down

0 comments on commit d9c3bff

Please sign in to comment.