microsoftgraph / aspnetcore-connect-sample

[ARCHIVED] This ASP.NET Core MVC sample shows how to connect to Microsoft Graph using delegated permissions and the Azure AD v2.0 (MSAL) endpoint.
MIT License
123 stars 96 forks source link

Error when running application (single-tenant vs multi-tenant) #65

Closed hgjura closed 1 year ago

hgjura commented 3 years ago

I run this app after filling in the details as instructed. I get this error after trying to Login

OpenIdConnectProtocolException: Message contains error: 'invalid_request', error_description: 'AADSTS50194: Application '{id}'({name} is not configured as a multi-tenant application. Usage of the /common endpoint is not supported for such applications created after '10/15/2018'. Use a tenant-specific endpoint or configure the application to be multi-tenant.

I did not see any instructions for this to be a multi-tenant app.

JerryLan01 commented 1 year ago

Has there been a resolution for this issue? I am having the same problem. My app is set to single-tenant. There is no "/common" endpoint in my code.

wayneelaf commented 1 year ago

I am getting the same error. Has there been any resolution? Any response would be appreciated. Thanks

jasonjoh commented 1 year ago

Closing issue as we are archiving this repository.

To answer your question: In single-tenant apps, MSAL must be given the tenant ID. You should be able to set the TenantId property in this section of appsettings.json:

https://github.com/microsoftgraph/aspnetcore-connect-sample/blob/4d237da78fc59d83ed358a57ab70694f810b98a1/MicrosoftGraphAspNetCoreConnectSample/appsettings.json#L2-L10