File tree Expand file tree Collapse file tree 4 files changed +16
-5
lines changed
Expand file tree Collapse file tree 4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ public static IEndpointRouteBuilder RegisterVisualisationEndpoints(this IEndpoin
2222
2323 group . MapPost ( "/Save" , SaveNetworkAsync )
2424 . ProducesProblem ( StatusCodes . Status500InternalServerError )
25- . RequireAuthorization ( "write" ) ;
25+ . RequireAuthorization ( "visualisation- write" ) ;
2626
27- group . RequireAuthorization ( "read" ) ;
27+ group . RequireAuthorization ( "visualisation- read" ) ;
2828
2929 return routes ;
3030 }
Original file line number Diff line number Diff line change 7373{
7474 options . AddPolicy ( "read" , policy => policy . RequireScope ( "dms.read" ) ) ;
7575 options . AddPolicy ( "write" , policy => policy . RequireScope ( "dms.write" ) ) ;
76+
77+ options . AddPolicy ( "visualisation-read" , policy =>
78+ policy . RequireAuthenticatedUser ( )
79+ . RequireScope ( "visualiser.read" )
80+ . AddAuthenticationSchemes ( JwtBearerDefaults . AuthenticationScheme ) ) ;
81+
82+ options . AddPolicy ( "visualisation-write" , policy =>
83+ policy . RequireAuthenticatedUser ( )
84+ . RequireScope ( "visualiser.write" )
85+ . AddAuthenticationSchemes ( JwtBearerDefaults . AuthenticationScheme ) ) ;
86+
7687 options . FallbackPolicy = options . DefaultPolicy ;
7788} ) ;
7889
Original file line number Diff line number Diff line change 1111 },
1212 "API" : {
1313 "Scopes" : [
14- " api://916ace49-a3db-4b11-84c5-6c4bd20260ef/dms .read" ,
15- " api://916ace49-a3db-4b11-84c5-6c4bd20260ef/dms .write"
14+ " api://916ace49-a3db-4b11-84c5-6c4bd20260ef/visualiser .read" ,
15+ " api://916ace49-a3db-4b11-84c5-6c4bd20260ef/visualiser .write"
1616 ]
1717 }
1818}
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ For more info see https://aka.ms/dotnet-template-ms-identity-platform
1717 "API" : {
1818 "BaseUrl" : " https://localhost:7013" ,
1919 "Scopes" : [
20- // E.g. "api://{api_client_id}/dms .read" and "api://{api_client_id}/dms .write"
20+ // E.g. "api://{api_client_id}/visualiser .read" and "api://{api_client_id}/visualiser .write"
2121 ]
2222 },
2323 "Serilog" : {
You can’t perform that action at this time.
0 commit comments