shedaltd / react-native-azure-ad-2

A React Native module for Microsoft Azure Identiry Authentication version 2. Implemented using pure Javascript and no others lib
MIT License
47 stars 71 forks source link

single tenant vs multi tenant Azure AD error #26

Closed psundharam01 closed 3 years ago

psundharam01 commented 3 years ago

Hello, I am developing a react-native app for my company - single tenant. When I run a simple example of azure authorization with this library, it connects to our azure AD and gets past username/password and MFA (text message) but then gives me the error AADSTS50194: Application 'xxxx' (myAppName) is not configured as a mutli-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 have tried everything on the Azure portal side for REDIRECT URIs, such as:

  1. https://localhost:19002/authentication/login-callback (I am still testing, developing the RN app locally using expo) - I am not sure if this is the right callback URI.
  2. https://login.microsoftonline.com/MY_COMPANY_TENANT_NAME

Is there anywhere within the code, this authentication requires a multi-tenant? Can we identify and modify that to a single tenant?

Any help on this will be really appreciated. Thanks.

wicfasho commented 3 years ago

Did you add the callback URI to the Azure AD?

psundharam01 commented 3 years ago

@wicfasho yes, I added the callback URI to Azure AD. I realized it had to be set to https://localhost:3000/login and it worked after that. Now I am trying to pass the access token to Power BI service API. Still struggling with that. But this code works! thanks for commenting.