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
Copy file name to clipboardExpand all lines: articles/active-directory/external-identities/customers/tutorial-desktop-maui-role-based-access-control.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,24 +37,24 @@ In this tutorial series, you created a .NET MAUI app where you developed the [_C
37
37
To access the role claim, you can modify the code snippet as follows:
// If the role claim exists, add it to the IdTokenClaims
49
+
IdTokenClaims=newList<string> { roleClaim };
50
+
}
51
+
else
52
+
{
53
+
// If the role claim doesn't exist, add a message indicating that no role claim was found
54
+
IdTokenClaims=newList<string> { "No role claim found in ID token" };
55
+
}
56
+
57
+
Claims.ItemsSource=IdTokenClaims;
58
58
```
59
59
60
-
> [!NOTE]
60
+
> [!NOTE]
61
61
> To read the Id token, you must install the `System.IdentityModel.Tokens.Jwt` package.
62
62
63
-
64
63
If you assign a user to multiple roles, the roles string contains all roles separated by a comma, such as `Orders.Manager, Store.Manager,...`. Make sure you build your application to handle the following conditions:
0 commit comments