Skip to content

Commit d9c3bff

Browse files
committed
Taking Jenny's feedback into account
1 parent f001102 commit d9c3bff

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

2. Web API now calls Microsoft Graph/TodoListService/Controllers/TodoListController.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4+
// The same code for the controller is used in both chapters of the tutorial.
5+
// In the first chapter this is just a protected API (ENABLE_OBO is not set)
6+
// In this chapter, the Web API calls a downstream API on behalf of the user (OBO)
47
#define ENABLE_OBO
58
using Microsoft.AspNetCore.Authorization;
69
using Microsoft.AspNetCore.Http;

Microsoft.Identity.Web/Client/TokenAcquisition.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ public void ReplyForbiddenWithWwwAuthenticateHeader(HttpContext httpContext, IEn
442442
string proposedAction = "consent";
443443
if (msalServiceException.ErrorCode == MsalError.InvalidGrantError)
444444
{
445-
if (AcceptedTokenVersionIsNotTheSameAsTokenVersion(msalServiceException))
445+
if (AcceptedTokenVersionMismatch(msalServiceException))
446446
{
447447
throw msalServiceException;
448448
}
@@ -473,7 +473,7 @@ public void ReplyForbiddenWithWwwAuthenticateHeader(HttpContext httpContext, IEn
473473
headers.Add(HeaderNames.WWWAuthenticate, v);
474474
}
475475

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

0 commit comments

Comments
 (0)