File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
TodoListService-ManualJwt Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff 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." ) ;
Original file line number Diff line number Diff 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" ;
You can’t perform that action at this time.
0 commit comments