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/organizationsCevap
- Chttps://login.microsoftonline.com/consumers
- Dhttps://login.microsoftonline.com/tenants
Cevap
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.
Adım Adım Çözüm
Anahtar Kavram
Microsoft Identity Platform multi-tenant authority endpoints
Tahmini Süre:1m 30s