11using Microsoft . AspNetCore . Authentication . JwtBearer ;
22using Microsoft . AspNetCore . Authorization ;
33using Microsoft . EntityFrameworkCore ;
4+ using Microsoft . IdentityModel . Logging ;
45using NetEscapades . AspNetCore . SecurityHeaders . Infrastructure ;
56using ResourceServer . Model ;
67using ResourceServer . Repositories ;
@@ -99,11 +100,13 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde
99100 {
100101 options . AddPolicy ( "dataEventRecordsAdmin" , policyAdmin =>
101102 {
102- policyAdmin . RequireClaim ( "role" , "dataEventRecords.admin" ) ;
103+ //policyAdmin.RequireClaim("role", "dataEventRecords.admin");
104+ policyAdmin . Requirements . Add ( new RequireScope ( ) ) ;
103105 } ) ;
104106 options . AddPolicy ( "dataEventRecordsUser" , policyUser =>
105107 {
106- policyUser . RequireClaim ( "role" , "dataEventRecords.user" ) ;
108+ //policyUser.RequireClaim("role", "dataEventRecords.user");
109+ policyUser . Requirements . Add ( new RequireScope ( ) ) ;
107110 } ) ;
108111 options . AddPolicy ( "dataEventRecordsPolicy" , policyUser =>
109112 {
@@ -120,6 +123,8 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde
120123
121124 public static WebApplication ConfigurePipeline ( this WebApplication app )
122125 {
126+ IdentityModelEventSource . ShowPII = true ;
127+
123128 var deploySwaggerUI = app . Configuration . GetValue < bool > ( "DeploySwaggerUI" ) ;
124129 app . UseCors ( "AllowAllOrigins" ) ;
125130
0 commit comments