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/app-provisioning/skip-out-of-scope-deletions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ This article describes how to use the Microsoft Graph API and the Microsoft Grap
20
20
* If ***SkipOutOfScopeDeletions*** is set to 0 (false), accounts that go out of scope are disabled in the target.
21
21
* If ***SkipOutOfScopeDeletions*** is set to 1 (true), accounts that go out of scope aren't disabled in the target. This flag is set at the *Provisioning App* level and can be configured using the Graph API.
22
22
23
-
Because this configuration is widely used with the *Workday to Active Directory user provisioning* app, the following steps include screenshots of the Workday application. However, the configuration can also be used with *all other apps*, such as ServiceNow, Salesforce, and Dropbox and [cross-tenant synchronization](../multi-tenant-organizations/cross-tenant-synchronization-configure.md). To successfully complete this procedure, you must have first set up app provisioning for the app. Each app has its own configuration article. For example, to configure the Workday application, see [Tutorial: Configure Workday to Azure AD user provisioning](../saas-apps/workday-inbound-cloud-only-tutorial.md).
23
+
Because this configuration is widely used with the *Workday to Active Directory user provisioning* app, the following steps include screenshots of the Workday application. However, the configuration can also be used with *all other apps*, such as ServiceNow, Salesforce, and Dropbox. To successfully complete this procedure, you must have first set up app provisioning for the app. Each app has its own configuration article. For example, to configure the Workday application, see [Tutorial: Configure Workday to Azure AD user provisioning](../saas-apps/workday-inbound-cloud-only-tutorial.md). SkipOutOfScopeDeletions does not work for cross-tenant synchronization.
24
24
25
25
## Step 1: Retrieve your Provisioning App Service Principal ID (Object ID)
Copy file name to clipboardExpand all lines: articles/active-directory/app-proxy/application-proxy-connectors.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ ms.service: active-directory
8
8
ms.subservice: app-proxy
9
9
ms.workload: identity
10
10
ms.topic: conceptual
11
-
ms.date: 11/17/2022
11
+
ms.date: 08/09/2023
12
12
ms.author: kenwith
13
13
ms.reviewer: ashishj
14
14
---
@@ -28,6 +28,8 @@ To deploy Application Proxy successfully, you need at least one connector, but w
28
28
### Windows Server
29
29
You need a server running Windows Server 2012 R2 or later on which you can install the Application Proxy connector. The server needs to connect to the Application Proxy services in Azure, and the on-premises applications that you're publishing.
30
30
31
+
Starting from the version 1.5.3437.0, having the .NET version 4.7.1 or greater is required for successful installation (upgrade).
32
+
31
33
The server needs to have TLS 1.2 enabled before you install the Application Proxy connector. To enable TLS 1.2 on the server:
32
34
33
35
1. Set the following registry keys:
@@ -36,7 +38,7 @@ The server needs to have TLS 1.2 enabled before you install the Application Prox
Copy file name to clipboardExpand all lines: articles/active-directory/external-identities/customers/tutorial-desktop-app-maui-sign-in-sign-out.md
+10-12Lines changed: 10 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,6 @@ The next steps will organize our code so that the `main view` is defined.
47
47
1. Select **Add**.
48
48
1. The _MainView.xaml_ file will open in a new document tab, displaying all of the XAML markup that represents the UI of the page. Replace the XAML markup with the following markup:
The `MainView` class is a content page responsible for displaying the main view of the app. In the constructor, it retrieves the cached user account using the `MSALClientHelper` from the `PublicClientSingleton` instance and enables the sign-in button, if no cached user account is found.
71
+
The `MainView` class is a content page responsible for displaying the main view of the app. In the constructor, it retrieves the cached user account using the `MSALClientHelper` from the `PublicClientSingleton` instance and enables the sign-in button, if no cached user account is found.
73
72
74
73
When the sign-in button is clicked, it calls the `AcquireTokenSilentAsync` method to acquire a token silently and navigates to the `claimsview` page using the `Shell.Current.GoToAsync` method. Additionally, the `OnBackButtonPressed` method is overridden to return true, indicating that the back button is disabled for this view.
75
74
@@ -84,14 +83,13 @@ The next steps will organize the code so that `ClaimsView` page is defined. The
84
83
1. Select **Add**.
85
84
1. The _ClaimsView.xaml_ file will open in a new document tab, displaying all of the XAML markup that represents the UI of the page. Replace the XAML markup with the following markup:
This XAML markup code represents the UI layout for a claim view in a .NET MAUI app. It starts by defining the `ContentPage` with a title and disabling the back button behavior.
91
-
92
-
Inside a `VerticalStackLayout`, there are several `Label` elements displaying static text, followed by a `ListView` named `Claims` that binds to a collection called `IdTokenClaims` to display the claims found in the ID token. Each claim is rendered within a `ViewCell` using a `DataTemplate` and displayed as a centered `Label` within a Grid.
93
-
94
-
Lastly, there's a `Sign Out` button centered at the bottom of the layout, which triggers the `SignOutButton_Clicked` event handler when clicked.
88
+
This XAML markup code represents the UI layout for a claim view in a .NET MAUI app. It starts by defining the `ContentPage` with a title and disabling the back button behavior.
89
+
90
+
Inside a `VerticalStackLayout`, there are several `Label` elements displaying static text, followed by a `ListView` named `Claims` that binds to a collection called `IdTokenClaims` to display the claims found in the ID token. Each claim is rendered within a `ViewCell` using a `DataTemplate` and displayed as a centered `Label` within a Grid.
91
+
92
+
Lastly, there's a `Sign Out` button centered at the bottom of the layout, which triggers the `SignOutButton_Clicked` event handler when clicked.
95
93
96
94
#### Handle the ClaimsView data
97
95
@@ -101,7 +99,7 @@ The next step is to add the code to handle `ClaimsView` data.
The _ClaimsView.xaml.cs_ code represents the code-behind for a claim view in a .NET MAUI app. It starts by importing the necessary namespaces and defining the `ClaimsView` class, which extends `ContentPage`. The `IdTokenClaims` property is an enumerable of strings, initially set to a single string indicating no claims found.
102
+
The _ClaimsView.xaml.cs_ code represents the code-behind for a claim view in a .NET MAUI app. It starts by importing the necessary namespaces and defining the `ClaimsView` class, which extends `ContentPage`. The `IdTokenClaims` property is an enumerable of strings, initially set to a single string indicating no claims found.
105
103
106
104
The `ClaimsView` constructor sets the binding context to the current instance, initializes the view components, and calls the `SetViewDataAsync` method asynchronously. The `SetViewDataAsync` method attempts to acquire a token silently, retrieves the claims from the authentication result, and sets the `IdTokenClaims` property to display them in the `ListView` named `Claims`. If a `MsalUiRequiredException` occurs, indicating that user interaction is needed for authentication, the app navigates to the claims view.
107
105
@@ -161,7 +159,7 @@ To create `appsettings.json`, follow these steps:
161
159
Set the **Debug Target** in the Visual Studio toolbar to the device you want to debug and test with. The following steps demonstrate setting the **Debug Target** to _Windows_:
162
160
163
161
1. Select **Debug Target** drop-down.
164
-
1. Select **Framework**
162
+
1. Select **Framework**
165
163
1. Select **net7.0-windows...**
166
164
167
165
Run the app by pressing _F5_ or select the _play button_ at the top of Visual Studio.
@@ -180,5 +178,5 @@ Run the app by pressing _F5_ or select the _play button_ at the top of Visual St
180
178
181
179
## Next Steps
182
180
183
-
-[Customize the default branding](how-to-customize-branding-customers.md).
184
-
-[Configure sign-in with Google](how-to-google-federation-customers.md).
181
+
> [!div class="nextstepaction"]
182
+
> [Tutorial: Add app roles to .NET MAUI app and receive them in the ID token](tutorial-desktop-maui-role-based-access-control.md)
title: "Tutorial: Use role-based access control in your .NET MAUI"
3
+
description: This tutorial demonstrates how to add app roles to .NET Multi-platform App UI (.NET MAUI) shell and receive them in the ID token.
4
+
author: henrymbuguakiarie
5
+
manager: mwongerapk
6
+
7
+
ms.author: henrymbugua
8
+
ms.service: active-directory
9
+
ms.topic: tutorial
10
+
ms.subservice: ciam
11
+
ms.date: 07/17/2023
12
+
---
13
+
14
+
# Tutorial: Use role-based access control in your .NET MAUI
15
+
16
+
This tutorial demonstrates how to add app roles to .NET Multi-platform App UI (.NET MAUI) and receive them in the ID token.
17
+
18
+
In this tutorial, you learn how to:
19
+
20
+
> [!div class="checklist"]
21
+
>
22
+
> - Access the roles in the ID token.
23
+
24
+
## Prerequisites
25
+
26
+
-[Tutorial: Sign in users in .NET MAUI shell app](tutorial-desktop-app-maui-sign-in-sign-out.md)
27
+
-[Using role-based access control for applications](how-to-use-app-roles-customers.md)
28
+
29
+
## Receive groups and roles claims in .NET MAUI
30
+
31
+
Once you configure your customer's tenant, you can retrieve your roles and groups claims in your client app. The roles and groups claims are both present in the ID token and the access token. Access tokens are only validated in the web APIs for which they were acquired by a client. The client shouldn't validate access tokens.
32
+
33
+
The .NET MAUI needs to check for the app roles claims in the ID token to implement authorization in the client side.
34
+
35
+
In this tutorial series, you created a .NET MAUI app where you developed the [_ClaimsView.xaml.cs_](tutorial-desktop-app-maui-sign-in-sign-out.md#handle-the-claimsview-data) to handle `ClaimsView` data. In this file, we inspect the contents of ID tokens. The value of the roles claim is checked in the following code snippet:
36
+
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
+
```
59
+
60
+
> [!NOTE]
61
+
> To read the ID token, you must install the `System.IdentityModel.Tokens.Jwt` package.
62
+
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:
64
+
65
+
- Absence of roles claims in the token
66
+
- User hasn't been assigned to any role
67
+
- Multiple values in the roles claim when you assign a user to multiple roles
68
+
69
+
When you define app roles for your app, it is your responsibility to implement authorization logic for those roles.
70
+
71
+
## Next steps
72
+
73
+
For more information about group claims and making informed decisions regarding the usage of app roles or groups, see:
74
+
75
+
-[Configuring group claims and app roles in tokens](/security/zero-trust/develop/configure-tokens-group-claims-app-roles)
76
+
-[Choose an approach](../../develop/custom-rbac-for-developers.md#choose-an-approach)
0 commit comments