You are developing a C# console application that needs to authenticate users using the Microsoft Identity Platform. The application must support signing in users from any Microsoft Entra ID tenant, but must explicitly prevent users with personal Microsoft accounts (such as Xbox, Outlook.com, or Skype accounts) from signing in.
You have the following C# code to build the public client application:
csharp
var app = PublicClientApplicationBuilder.Create(clientId)
.WithAuthority(authority)
.WithRedirectUri(redirectUri)
.Build();
Which value should you assign to the `authority` variable?
- Ahttps://login.microsoftonline.com/common
- https://login.microsoftonline.com/organizationsAnswer
- Chttps://login.microsoftonline.com/consumers
- Dhttps://login.microsoftonline.com/tenants
Answer
https://login.microsoftonline.com/organizations
The authority endpoint https://login.microsoftonline.com/organizations is designed specifically for multi-tenant applications that only allow work or school accounts from Microsoft Entra ID tenants, thereby excluding personal Microsoft accounts.
Step-by-Step Solution
Key Concept
Microsoft Identity Platform multi-tenant authority endpoints
Estimated Time:1m 30s