You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Inthe `ConfigureServices` methodof `Startup.cs', the following line instructs the asp.net security middleware to use the **roles** claim to fetch roles for authorization:
220
227
221
228
```CSharp
222
-
// The claim in the Jwt token where App roles are available.
1. In the `ConfigureServices` method of `Startup.cs', the following line instructs the asp.net security middleware to use the **roles** claim to fetch roles for authorization:
317
323
318
324
```CSharp
319
-
// The claim in the Jwt token where App roles are available.
1. In the `HomeController.cs`, the following method is added with the `Authorize` attribute with the name of the policy that enforces that the signed-in user is present in the app role **UserReaders**, that permits listing of users in the tenant.
1. A new class called `AccountController.cs` is introduced. This contains the code to intercept the default AccessDenied error's route and present the user with an option to sign-out and sign-back in with a different account that has access to the required role.
@@ -328,10 +342,10 @@ This project was created using the following command.
1. The following method is also added with the `Authorize` attribute with the name of the policy that enforces that the signed-in user is present in the app role **DirectoryViewers**, that permits listing of roles and groups the signed-in user is assigned to.
0 commit comments