A development team is building a native C# client application that runs on domain-joined user workstations. The application needs to request an access token from the Microsoft Identity Platform to query a secure downstream Web API. The solution must support user accounts from any Microsoft Entra ID tenant as well as personal Microsoft accounts. Which approach should the team use to initialize the client application and configure authentication?
- AGrant access to a shared client secret using a Key Vault access policy and initialize the application using ConfidentialClientApplicationBuilder.
- BConfigure a system-assigned managed identity for the user workstations and initialize the application using ManagedIdentityApplicationBuilder.
- Initialize the client application using PublicClientApplicationBuilder.Create(clientId).WithAuthority(AzureCloudInstance.AzurePublic, "common").Build();Cevap
- DGenerate a Shared Access Signature (SAS) token for the Web API and configure the client application to authenticate using the token.
Cevap
Initialize the client application using PublicClientApplicationBuilder.Create(clientId).WithAuthority(AzureCloudInstance.AzurePublic, "common").Build();
The correct answer initializes the client application as a public client application. Applications running on desktop computers are classified as public clients since they cannot keep client secrets confidential. The 'common' authority endpoint supports logging in users from any organizational directory (multi-tenant) as well as personal Microsoft accounts.
Adım Adım Çözüm
Anahtar Kavram
MSAL.NET client application classification and authority selection