Skip to content

Commit 3077a35

Browse files
authored
Merge pull request #247884 from MicrosoftDocs/main
Merge main to live, 4 AM
2 parents 445909b + 9f80ebe commit 3077a35

File tree

153 files changed

+2543
-2315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+2543
-2315
lines changed

.openpublishing.redirection.azure-monitor.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6279,6 +6279,26 @@
62796279
"source_path_from_root": "/articles/azure-monitor/essentials/prometheus-authorization-proxy.md",
62806280
"redirect_url": "/azure/azure-monitor/containers/prometheus-authorization-proxy",
62816281
"redirect_document_id": false
6282+
},
6283+
{
6284+
"source_path_from_root": "/articles/azure-monitor/containers/container-insights-hybrid-setup.md",
6285+
"redirect_url": "/azure/azure-monitor/containers/container-insights-enable-arc-enabled-clusters",
6286+
"redirect_document_id": false
6287+
},
6288+
{
6289+
"source_path_from_root": "/articles/azure-monitor/containers/container-insights-optout-openshift-v3.md",
6290+
"redirect_url": "/azure/azure-monitor/containers/container-insights-optout",
6291+
"redirect_document_id": false
6292+
},
6293+
{
6294+
"source_path_from_root": "/articles/azure-monitor/containers/container-insights-optout-openshift-v4.md",
6295+
"redirect_url": "/azure/azure-monitor/containers/container-insights-optout",
6296+
"redirect_document_id": false
6297+
},
6298+
{
6299+
"source_path_from_root": "/articles/azure-monitor/containers/container-insights-optout-hybrid.md",
6300+
"redirect_url": "/azure/azure-monitor/containers/container-insights-optout",
6301+
"redirect_document_id": false
62826302
}
62836303
]
62846304
}

articles/active-directory/cloud-infrastructure-entitlement-management/onboard-gcp.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ ms.service: active-directory
88
ms.subservice: ciem
99
ms.workload: identity
1010
ms.topic: how-to
11-
ms.date: 06/16/2023
11+
ms.date: 08/09/2023
1212
ms.author: jfields
1313
---
1414

1515
# Onboard a Google Cloud Platform (GCP) project
1616

17-
This article describes how to onboard a Google Cloud Platform (GCP) project on Permissions Management.
17+
This article describes how to onboard a Google Cloud Platform (GCP) project in Microsoft Entra Permissions Management.
1818

1919
> [!NOTE]
2020
> A *global administrator* or *super admin* (an admin for all authorization system types) can perform the tasks in this article after the global administrator has initially completed the steps provided in [Enable Permissions Management on your Azure Active Directory tenant](onboard-enable-tenant.md).
2121
2222
## Explanation
2323

24-
For GCP, permissions management is scoped to a *GCP project*. A GCP project is a logical collection of your resources in GCP, like a subscription in Azure, albeit with further configurations you can perform such as application registrations and OIDC configurations.
24+
For GCP, Permissions Management is scoped to a *GCP project*. A GCP project is a logical collection of your resources in GCP, like a subscription in Azure, but with further configurations you can perform such as application registrations and OIDC configurations.
2525

2626
<!-- Diagram from Gargi-->
2727

28-
There are several moving parts across GCP and Azure, which are required to be configured before onboarding.
28+
There are several moving parts across GCP and Azure, which should be configured before onboarding.
2929

3030
* An Azure AD OIDC App
3131
* A Workload Identity in GCP
@@ -39,7 +39,7 @@ There are several moving parts across GCP and Azure, which are required to be co
3939

4040
- In the Permissions Management home page, select **Settings** (the gear icon), and then select the **Data Collectors** subtab.
4141

42-
1. On the **Data Collectors** tab, select **GCP**, and then select **Create Configuration**.
42+
1. On the **Data Collectors** tab, select **GCP**, then select **Create Configuration**.
4343

4444
### 1. Create an Azure AD OIDC app.
4545

@@ -50,7 +50,7 @@ There are several moving parts across GCP and Azure, which are required to be co
5050
1. To create the app registration, copy the script and run it in your command-line app.
5151

5252
> [!NOTE]
53-
> 1. To confirm that the app was created, open **App registrations** in Azure and, on the **All applications** tab, locate your app.
53+
> 1. To confirm the app was created, open **App registrations** in Azure and, on the **All applications** tab, locate your app.
5454
> 1. Select the app name to open the **Expose an API** page. The **Application ID URI** displayed in the **Overview** page is the *audience value* used while making an OIDC connection with your GCP account.
5555
> 1. Return to the Permissions Management window, and in the **Permissions Management Onboarding - Azure AD OIDC App Creation**, select **Next**.
5656
@@ -73,15 +73,15 @@ Choose from three options to manage GCP projects.
7373

7474
#### Option 1: Automatically manage
7575

76-
The automatically manage option allows projects to be automatically detected and monitored without extra configuration. Steps to detect list of projects and onboard for collection:
76+
The automatically manage option allows you to automatically detect and monitor projects without extra configuration. Steps to detect a list of projects and onboard for collection:
7777

78-
1. Firstly, grant **Viewer** and **Security Reviewer** role to service account created in previous step at organization, folder or project scope.
78+
1. Grant **Viewer** and **Security Reviewer** roles to a service account created in the previous step at a project, folder or organization level.
7979

80-
To enable controller mode 'On' for any projects, add following roles to the specific projects:
80+
To enable Controller mode **On** for any projects, add these roles to the specific projects:
8181
- Role Administrators
8282
- Security Admin
8383

84-
2. Once done, the steps are listed in the screen, which shows how to further configure in the GPC console, or programmatically with the gCloud CLI.
84+
The required commands to run in Google Cloud Shell are listed in the Manage Authorization screen for each scope of a project, folder or organization. This is also configured in the GPC console.
8585

8686
3. Select **Next**.
8787

@@ -93,34 +93,36 @@ You have the ability to specify only certain GCP member projects to manage and m
9393

9494
2. You can choose to download and run the script at this point, or you can do it via Google Cloud Shell.
9595

96-
To enable controller mode 'On' for any projects, add following roles to the specific projects:
96+
To enable controller mode 'On' for any projects, add these roles to the specific projects:
9797
- Role Administrators
9898
- Security Admin
9999

100100
3. Select **Next**.
101101

102102
#### Option 3: Select authorization systems
103103

104-
This option detects all projects that are accessible by the Cloud Infrastructure Entitlement Management application.
104+
This option detects all projects accessible by the Cloud Infrastructure Entitlement Management application.
105105

106-
1. Firstly, grant Viewer and Security Reviewer role to service account created in previous step at organization, folder or project scope
106+
1. Grant **Viewer** and **Security Reviewer** roles to a service account created in the previous step at a project, folder or organization level.
107+
108+
To enable Controller mode **On** for any projects, add these roles to the specific projects:
109+
- Role Administrators
110+
- Security Admin
111+
112+
The required commands to run in Google Cloud Shell are listed in the Manage Authorization screen for each scope of a project, folder or organization. This is also configured in the GPC console.
107113

108-
To enable controller mode 'On' for any projects, add following roles to the specific projects:
109-
- Role Administrators
110-
- Security Admin
111-
2. Once done, the steps are listed in the screen to do configure manually in the GPC console, or programmatically with the gCloud CLI
112114
3. Select **Next**.
113115

114116

115117
### 3. Review and save.
116118

117119
- In the **Permissions Management Onboarding – Summary** page, review the information you've added, and then select **Verify Now & Save**.
118120

119-
The following message appears: **Successfully Created Configuration.**
121+
The following message appears: **Successfully Created Configuration**.
120122

121123
On the **Data Collectors** tab, the **Recently Uploaded On** column displays **Collecting**. The **Recently Transformed On** column displays **Processing.**
122124

123-
You have now completed onboarding GCP, and Permissions Management has started collecting and processing your data.
125+
You've completed onboarding GCP, and Permissions Management has started collecting and processing your data.
124126

125127
### 4. View the data.
126128

articles/active-directory/external-identities/customers/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ items:
202202
href: tutorial-desktop-app-maui-sign-in-prepare-app.md
203203
- name: Sign in and sign out
204204
href: tutorial-desktop-app-maui-sign-in-sign-out.md
205+
- name: Use role-based access control
206+
href: tutorial-desktop-maui-role-based-access-control.md
205207
- name: .NET WPF
206208
items:
207209
- name: Prepare tenant
@@ -219,6 +221,8 @@ items:
219221
href: tutorial-mobile-app-maui-sign-in-prepare-app.md
220222
- name: Sign in and sign out
221223
href: tutorial-mobile-app-maui-sign-in-sign-out.md
224+
- name: Use role-based access control
225+
href: tutorial-mobile-maui-role-based-access-control.md
222226
- name: Command-line interface (CLI) app
223227
items:
224228
- name: Node.js - sign in users

articles/active-directory/external-identities/customers/tutorial-desktop-app-maui-sign-in-sign-out.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ The next steps will organize our code so that the `main view` is defined.
4747
1. Select **Add**.
4848
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:
4949

50-
5150
:::code language="xaml" source="~/ms-identity-ciam-dotnet-tutorial/1-Authentication/2-sign-in-maui/Views/MainView.xaml" :::
5251

5352
1. Save the file.
@@ -69,7 +68,7 @@ The next step is to add the code for the button's `Clicked` event.
6968

7069
:::code language="csharp" source="~/ms-identity-ciam-dotnet-tutorial/1-Authentication/2-sign-in-maui/Views/MainView.xaml.cs" :::
7170

72-
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.
7372

7473
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.
7574

@@ -84,14 +83,13 @@ The next steps will organize the code so that `ClaimsView` page is defined. The
8483
1. Select **Add**.
8584
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:
8685

87-
8886
:::code language="xaml" source="~/ms-identity-ciam-dotnet-tutorial/1-Authentication/2-sign-in-maui/Views/ClaimsView.xaml" :::
8987

90-
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.
9593

9694
#### Handle the ClaimsView data
9795

@@ -101,7 +99,7 @@ The next step is to add the code to handle `ClaimsView` data.
10199

102100
:::code language="csharp" source="~/ms-identity-ciam-dotnet-tutorial/1-Authentication/2-sign-in-maui/Views/ClaimsView.xaml.cs" :::
103101

104-
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.
105103

106104
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.
107105

@@ -161,7 +159,7 @@ To create `appsettings.json`, follow these steps:
161159
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_:
162160

163161
1. Select **Debug Target** drop-down.
164-
1. Select **Framework**
162+
1. Select **Framework**
165163
1. Select **net7.0-windows...**
166164

167165
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
180178

181179
## Next Steps
182180

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)
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
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:
38+
39+
```csharp
40+
var idToken = PublicClientSingleton.Instance.MSALClientHelper.AuthResult.IdToken;
41+
var handler = new JwtSecurityTokenHandler();
42+
var token = handler.ReadJwtToken(idToken);
43+
// Get the role claim value
44+
var roleClaim = token.Claims.FirstOrDefault(c => c.Type == "roles")?.Value;
45+
46+
if (!string.IsNullOrEmpty(roleClaim))
47+
{
48+
// If the role claim exists, add it to the IdTokenClaims
49+
IdTokenClaims = new List<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 = new List<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

Comments
 (0)