Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04e66f2

Browse files
alexwolfmsftscottaddiegewarren
authored
Refactor more language agnostic content into includes (#49651)
* Refactor more language agnostic content into includes Co-authored-by: Scott Addie <[email protected]> Co-authored-by: Genevieve Warren <[email protected]> --------- Co-authored-by: Scott Addie <[email protected]> Co-authored-by: Genevieve Warren <[email protected]>
1 parent c969230 commit 04e66f2

File tree

7 files changed

+87
-51
lines changed

7 files changed

+87
-51
lines changed

docs/azure/sdk/authentication/local-development-broker.md

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -9,74 +9,29 @@ zone_pivot_groups: operating-systems-set-one
99

1010
# Authenticate .NET apps to Azure services during local development using brokered authentication
1111

12-
Brokered authentication collects user credentials using the system authentication broker to authenticate an app with <xref:Azure.Identity.InteractiveBrowserCredential>. A system authentication broker is an app running on a user's machine that manages the authentication handshakes and token maintenance for all connected accounts.
13-
14-
Brokered authentication offers the following benefits:
15-
16-
- **Enables Single Sign-On (SSO):** Enables apps to simplify how users authenticate with Microsoft Entra ID and protects Microsoft Entra ID refresh tokens from exfiltration and misuse.
17-
- **Enhanced security:** Many security enhancements are delivered with the broker, without needing to update the app logic.
18-
- **Enhanced feature support:** With the help of the broker, developers can access rich OS and service capabilities.
19-
- **System integration:** Applications that use the broker plug-and-play with the built-in account picker, allowing the user to quickly pick an existing account instead of reentering the same credentials over and over.
20-
- **Token Protection:** Ensures that the refresh tokens are device bound and enables apps to acquire device bound access tokens. See [Token Protection](/azure/active-directory/conditional-access/concept-token-protection).
12+
[!INCLUDE [broker-intro](../includes/broker-intro.md)]
2113

2214
:::zone target="docs" pivot="os-windows"
2315

24-
Windows provides an authentication broker called [Web Account Manager (WAM)](/entra/msal/dotnet/acquiring-tokens/desktop-mobile/wam). WAM enables identity providers such as Microsoft Entra ID to natively plug into the OS and provide secure login services to apps. Brokered authentication enables the app for all operations allowed by the interactive login credentials.
25-
26-
Personal Microsoft accounts and work or school accounts are supported. On supported Windows versions, the default browser-based UI is replaced with a smoother authentication experience, similar to built-in Windows apps.
16+
[!INCLUDE [broker-windows](../includes/broker-windows.md)]
2717

2818
:::zone-end
2919

3020
:::zone target="docs" pivot="os-macos"
3121

32-
macOS doesn't natively include a built-in authentication broker. Brokered authentication is supported via the `Azure.Identity.Broker` library, which uses platform-specific mechanisms and may integrate with apps like Microsoft Company Portal when devices are managed. For more information, see [Microsoft Enterprise SSO plug-in for Apple devices](/entra/identity-platform/apple-sso-plugin).
22+
[!INCLUDE [broker-mac](../includes/broker-mac.md)]
3323

3424
:::zone-end
3525

3626
:::zone target="docs" pivot="os-linux"
3727

38-
Linux uses [Microsoft single sign-on for Linux](/entra/identity/devices/sso-linux) as its authentication broker.
28+
[!INCLUDE [broker-linux](../includes/broker-linux.md)]
3929

4030
:::zone-end
4131

42-
## Configure the app for brokered authentication
43-
44-
To enable brokered authentication in your application, follow these steps:
45-
46-
1. In the [Azure portal](https://portal.azure.com), navigate to **Microsoft Entra ID** and select **App registrations** on the left-hand menu.
47-
1. Select the registration for your app, then select **Authentication**.
48-
1. Add the appropriate redirect URI to your app registration via a platform configuration:
49-
1. Under **Platform configurations**, select **+ Add a platform**.
50-
1. Under **Configure platforms**, select the tile for your application type (platform) to configure its settings, such as **mobile and desktop applications**.
51-
1. In **Custom redirect URIs**, enter the following redirect URI for your platform:
52-
53-
| Platform | Redirect URI |
54-
|-------------|-----------------------------------------------------------------------------------------------------------------------|
55-
| Windows 10+ or WSL | `ms-appx-web://Microsoft.AAD.BrokerPlugin/{your_client_id}` |
56-
| macOS | `msauth.com.msauth.unsignedapp://auth` for unsigned apps<br>`msauth.{bundle_id}://auth` for signed apps |
57-
| Linux | `https://login.microsoftonline.com/common/oauth2/nativeclient` |
58-
59-
Replace `{your_client_id}` or `{bundle_id}` with the **Application (client) ID** from the app registration's **Overview** pane.
60-
61-
1. Select **Configure**.
62-
63-
To learn more, see [Add a redirect URI to an app registration](/entra/identity-platform/quickstart-register-app#add-a-redirect-uri).
64-
65-
1. Back on the **Authentication** pane, under **Advanced settings**, select **Yes** for **Allow public client flows**.
66-
1. Select **Save** to apply the changes.
67-
1. To authorize the application for specific resources, navigate to the resource in question, select **API Permissions**, and enable **Microsoft Graph** and other resources you want to access.
68-
69-
> [!IMPORTANT]
70-
> You must also be the admin of your tenant to grant consent to your application when you sign in for the first time.
71-
72-
## Assign roles
73-
74-
To run your app code successfully with brokered authentication, grant your user account permissions using [Azure role-based access control (RBAC)](/azure/role-based-access-control/overview). Assign an appropriate role to your user account for the relevant Azure service. For example:
75-
76-
- **Azure Blob Storage**: Assign the **Storage Account Data Contributor** role.
77-
- **Azure Key Vault**: Assign the **Key Vault Secrets Officer** role.
32+
[!INCLUDE [broker-configure-app](../includes/broker-configure-app.md)]
7833

79-
If an app is specified, it must have API permissions set for **user_impersonation Access Azure Storage** (step 6 in the previous section). This API permission allows the app to access Azure storage on behalf of the signed-in user after consent is granted during sign-in.
34+
[!INCLUDE [broker-assign-roles](../includes/broker-assign-roles.md)]
8035

8136
## Implement the code
8237

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
ms.topic: include
3+
ms.date: 03/19/2025
4+
---
5+
6+
## Assign roles
7+
8+
To run your app code successfully with brokered authentication, grant your user account permissions using [Azure role-based access control (RBAC)](/azure/role-based-access-control/overview). Assign an appropriate role to your user account for the relevant Azure service. For example:
9+
10+
- **Azure Blob Storage**: Assign the **Storage Account Data Contributor** role.
11+
- **Azure Key Vault**: Assign the **Key Vault Secrets Officer** role.
12+
13+
If an app is specified, it must have API permissions set for **user_impersonation Access Azure Storage** (step 6 in the previous section). This API permission allows the app to access Azure storage on behalf of the signed-in user after consent is granted during sign-in.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
ms.topic: include
3+
ms.date: 03/19/2025
4+
---
5+
6+
## Configure the app for brokered authentication
7+
8+
To enable brokered authentication in your application, follow these steps:
9+
10+
1. In the [Azure portal](https://portal.azure.com), navigate to **Microsoft Entra ID** and select **App registrations** on the left-hand menu.
11+
1. Select the registration for your app, then select **Authentication**.
12+
1. Add the appropriate redirect URI to your app registration via a platform configuration:
13+
1. Under **Platform configurations**, select **+ Add a platform**.
14+
1. Under **Configure platforms**, select the tile for your application type (platform) to configure its settings, such as **mobile and desktop applications**.
15+
1. In **Custom redirect URIs**, enter the following redirect URI for your platform:
16+
17+
| Platform | Redirect URI |
18+
|-------------|-----------------------------------------------------------------------------------------------------------------------|
19+
| Windows 10+ or WSL | `ms-appx-web://Microsoft.AAD.BrokerPlugin/{your_client_id}` |
20+
| macOS | `msauth.com.msauth.unsignedapp://auth` for unsigned apps<br>`msauth.{bundle_id}://auth` for signed apps |
21+
| Linux | `https://login.microsoftonline.com/common/oauth2/nativeclient` |
22+
23+
Replace `{your_client_id}` or `{bundle_id}` with the **Application (client) ID** from the app registration's **Overview** pane.
24+
25+
1. Select **Configure**.
26+
27+
To learn more, see [Add a redirect URI to an app registration](/entra/identity-platform/quickstart-register-app#add-a-redirect-uri).
28+
29+
1. Back on the **Authentication** pane, under **Advanced settings**, select **Yes** for **Allow public client flows**.
30+
1. Select **Save** to apply the changes.
31+
1. To authorize the application for specific resources, navigate to the resource in question, select **API Permissions**, and enable **Microsoft Graph** and other resources you want to access.
32+
33+
> [!IMPORTANT]
34+
> You must also be the admin of your tenant to grant consent to your application when you sign in for the first time.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
ms.topic: include
3+
ms.date: 04/25/2025
4+
---
5+
6+
Brokered authentication collects user credentials using the system authentication broker to authenticate an app. A system authentication broker is an app running on a user's machine that manages the authentication handshakes and token maintenance for all connected accounts.
7+
8+
Brokered authentication offers the following benefits:
9+
10+
- **Enables Single Sign-On (SSO):** Enables apps to simplify how users authenticate with Microsoft Entra ID and protects Microsoft Entra ID refresh tokens from exfiltration and misuse.
11+
- **Enhanced security:** Many security enhancements are delivered with the broker, without needing to update the app logic.
12+
- **Enhanced feature support:** With the help of the broker, developers can access rich OS and service capabilities.
13+
- **System integration:** Applications that use the broker plug-and-play with the built-in account picker, allowing the user to quickly pick an existing account instead of re-entering the same credentials over and over.
14+
- **Token Protection:** Ensures that the refresh tokens are device bound and enables apps to acquire device bound access tokens. For more information, see [Token Protection](/azure/active-directory/conditional-access/concept-token-protection).
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
ms.topic: include
3+
ms.date: 04/25/2025
4+
---
5+
6+
Linux uses [Microsoft single sign-on for Linux](/entra/identity/devices/sso-linux) as its authentication broker.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
ms.topic: include
3+
ms.date: 04/25/2025
4+
---
5+
6+
macOS doesn't natively include a built-in authentication broker. The Azure Identity client library implements brokered authentication features using platform-specific mechanisms and can integrate with apps like Microsoft Company Portal when devices are managed. For more information, see [Microsoft Enterprise SSO plug-in for Apple devices](/entra/identity-platform/apple-sso-plugin).
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
ms.topic: include
3+
ms.date: 04/25/2025
4+
---
5+
6+
Windows provides an authentication broker called [Web Account Manager (WAM)](/entra/msal/dotnet/acquiring-tokens/desktop-mobile/wam). WAM enables identity providers such as Microsoft Entra ID to natively plug into the OS and provide secure login services to apps. Brokered authentication enables the app for all operations allowed by the interactive login credentials.
7+
8+
Personal Microsoft accounts and work or school accounts are supported. On supported Windows versions, the default browser-based UI is replaced with a smoother authentication experience, similar to built-in Windows apps.

0 commit comments

Comments
 (0)