Skip to content

Commit bf439a0

Browse files
author
Kalyan Krishna
committed
Minor changes
1 parent 3e4d8c1 commit bf439a0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

TodoListService-ManualJwt/Global.asax.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage
139139
ValidIssuers = validissuers,
140140
IssuerSigningKeys = config.SigningKeys
141141

142-
// Please inspect TokenValidationParameters class for a lot more validation parameters.
142+
// Please inspect TokenValidationParameters class for a lot more validation parameters.
143143
};
144144

145145
try
@@ -151,7 +151,8 @@ protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage
151151
#pragma warning disable 1998
152152
// This check is required to ensure that the Web API only accepts tokens from tenants where it has been consented to and provisioned.
153153
if (!claimsPrincipal.Claims.Any(x => x.Type == ClaimConstants.ScopeClaimType)
154-
&& !claimsPrincipal.Claims.Any(y => y.Type == ClaimConstants.RolesClaimType))
154+
&& !claimsPrincipal.Claims.Any(y => y.Type == ClaimConstants.ScpClaimType)
155+
&& !claimsPrincipal.Claims.Any(y => y.Type == ClaimConstants.RolesClaimType))
155156
{
156157
#if DEBUG
157158
return BuildResponseErrorMessage(HttpStatusCode.Forbidden, "Neither 'scope' or 'roles' claim was found in the bearer token.");

TodoListService-ManualJwt/Utils/ClaimConstants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public static class ClaimConstants
3636
public const string TenantId = "http://schemas.microsoft.com/identity/claims/tenantid";
3737
public const string Tid = "tid";
3838
public const string ScopeClaimType = "http://schemas.microsoft.com/identity/claims/scope";
39+
public const string ScpClaimType = "scp";
3940
public const string RolesClaimType = "roles";
4041

4142
public const string ScopeClaimValue = "access_as_user";

0 commit comments

Comments
 (0)