Soru

Zorluk: ZorMicrosoft Identity Platform Authentication

You are developing a C# desktop application using MSAL.NET that will run on Windows 11 client machines. The application must authenticate users against Microsoft Entra ID and support Single Sign-On (SSO) using the native Windows Web Account Manager (WAM) broker. You need to configure the Microsoft Entra ID application registration and the C# initialization code. Which two configuration steps should you perform? Select two.

  1. In the Microsoft Entra ID application registration, configure a Redirect URI using the format ms-appx-web://microsoft.aad.brokerplugin/{ClientId}.Cevap
  2. Initialize the client application using PublicClientApplicationBuilder and call the WithBroker method with Windows broker options enabled.Cevap
  3. C
    Initialize the client application using ConfidentialClientApplicationBuilder and configure the client secret to authenticate via WAM.
  4. D
    In the Microsoft Entra ID application registration, configure a Redirect URI using the default native client URI: https://login.microsoftonline.com/common/oauth2/nativeclient.
  5. E
    Initialize the client application using PublicClientApplicationBuilder and call the WithSystemWebViewOptions method to delegate authentication to WAM.

Cevap

Configure a Redirect URI in Microsoft Entra ID using the format ms-appx-web://microsoft.aad.brokerplugin/{ClientId}, and initialize the application using PublicClientApplicationBuilder while calling WithBroker with Windows broker options enabled.
To configure Windows Web Account Manager (WAM) broker authentication, you must register a Redirect URI matching the 'ms-appx-web://microsoft.aad.brokerplugin/{ClientId}' pattern in Entra ID and call the 'WithBroker' method with Windows options on the 'PublicClientApplicationBuilder'. This allows the application to utilize WAM for native Single Sign-On.

Adım Adım Çözüm

1
Register the correct redirect URI pattern in Microsoft Entra ID for the public client application.
The application registration now contains the ms-appx-web://microsoft.aad.brokerplugin/{ClientId} redirect URI, allowing the Entra ID authorization endpoint to redirect tokens back to the native WAM broker.
Windows broker authentication requires a specific callback scheme to identify the broker handler.
2
Use the MSAL.NET PublicClientApplicationBuilder in your C# application code.
The application is initialized as a public client (desktop) application, which is suitable for client-side execution.
A public client application is required for interactive token acquisition and integration with OS brokers.
3
Call the WithBroker extension method passing Windows operating system broker options.
MSAL.NET enables interaction with the local Windows WAM broker for SSO authentication.
Enabling the broker runtime bypasses the browser flow and uses the OS native broker for a seamless user experience.

Anahtar Kavram

Configuring Single Sign-On (SSO) with Web Account Manager (WAM) broker authentication in MSAL.NET and Microsoft Entra ID.
Tahmini Süre:2m 0s
Bu soruyu puanla