alexandrtovmach / react-microsoft-login

Microsoft services authorization with React.
https://alexandrtovmach.github.io/react-microsoft-login
MIT License
80 stars 38 forks source link

common endpoint is not supported for such applications created after '10/15/2018' #73

Closed BHARANA4 closed 3 years ago

BHARANA4 commented 3 years ago

Steps to reproduce: AADSTS50194: Application '58c5e948-c3a2-4b7c-b9a4-93f5c10091be'(Avatar_clr_45277_RITM1177190) 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.

alexandrtovmach commented 3 years ago

@BHARANA4 There is no enough information to reproduce, could you provide your code and explain what you have

FranCarstens commented 3 years ago

This issue occurs when the application is set to single tenant only. For example an internal application.

Supported account types

Who can use this application or access this API?
 [x] Accounts in this organizational directory only (Your company only - Single tenant)
 [ ] Accounts in any organizational directory (Any Azure AD directory - Multitenant)

You can solve this by adding your tenant URL which is made of the long URL and your tenant ID. Your tenant ID is listed right below your client ID on your app's overview page.

https://login.microsoftonline.com/ + Directory (tenant) ID

<MicrosoftLogin
  clientId={clientId}
  tenantUrl={`https://login.microsoftonline.com/${tenantID}`}
  authCallback={authHandler}
  ...
alexandrtovmach commented 3 years ago

Answered here https://github.com/alexandrtovmach/react-microsoft-login/issues/73#issuecomment-805286786