'"Use a tenant-specific endpoint or configure the application to be multi-tenant" when signing into my Azure website
I'm getting this error after I sign into my Azure website:
AADSTS50194: Application 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx' 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.
Solution 1:[1]
It turns out that my account was not actually on Azure AD, so I needed to check "Accounts in any organizational directory" under "Supported account types" on portal.azure.com
Specifically: portal.azure.com > Azure Active Directory > App registrations (preview) > Your App > Authentication > Supported account types > Accounts in any organizational directory
Solution 2:[2]
Enable multi-tenant using the below option in azure.
portal.azure.com -> Azure Active Directory -> App registrations -> Select Your App -> Authentication -> Supported account types -> Accounts in any organizational directory (Any Azure AD directory - Multitenant)
this should be enabled when you want to allow public users.
If you are want to authorize the user into organization level(Private Users). Use the below option.
let authUrl = "https://login.microsoftonline.com/common"
change like below:
let authUrl= "https://login.microsoftonline.com/MY_TENANT_NAME"
Solution 3:[3]
For some reason YOUR_TENANT_NAME did not seem to work for me. It has worked for others hence you should still try it.
Instead of the above solutions the following worked for me:
authority: "https://login.microsoftonline.com/Your_Tenant_ID"
You can find Your_Tenant_ID by typing Tenant Properties in the Azure search bar.
Solution 4:[4]
Further more to @Coruscate5's post, which has helped me, you can set WithAuthority for iOS as follows.
var builder = PublicClientApplicationBuilder.Create(OAuthSettings.ApplicationId)**.WithAuthority("https://login.microsoftonline.com/YOUR_TENANT_NAME");**
This is important if you were following the Build Xamarin apps with Microsoft Graph guide and you aren't authenticating to a multi-tenant application.
This is how you get your tenant name:
https://docs.microsoft.com/en-us/onedrive/find-your-office-365-tenant-id
Solution 5:[5]
I stumbled upon here with the same error but using python to authenticate my API calls.
Specifically I was using authOAuthDesktopMobileAuthCodeGrant class from bingads.authorization
The init for authOAuthDesktopMobileAuthCodeGrant shows the following, note that tenant attribute is defaulted to "common".
def __init__(self, client_id, oauth_tokens=None, env=PRODUCTION, oauth_scope=MSADS_MANAGE, tenant='common'):
Therefore, in order to not default to /common like others have highlighted above. I had to set this tenant component here to my app's tenant ID
authentication = OAuthDesktopMobileAuthCodeGrant(
client_id=client_id,
tenant="{YOUR_TENANT_ID}",
env='production'
Hope this is useful to others who are working out of python.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | DharmaTurtle |
| Solution 2 | |
| Solution 3 | |
| Solution 4 | Jeremy Caney |
| Solution 5 | FeBludger |

