“Use a tenant-specific endpoint or configure the application to be multi-tenant” when signing into my Azure website

后端 未结 4 1040
说谎
说谎 2020-12-17 08:40

I\'m getting this error after I sign into my Azure website:

AADSTS50194: Application \'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx\' is not configured as a

相关标签:
4条回答
  • 2020-12-17 09:03

    If you are an Azure administrator getting this message, it may be for the the exact reason that is listed in the error message - you can not use the common API endpoint to MSFT logins to tenant-specific applications.

    In my case, I was configuring an app registration with sample code - the sample code needed to be modified with a new endpoint. I.e the following line:

    let kAuthority = "https://login.microsoftonline.com/common"

    needed to be changed to:

    let kAuthority = "https://login.microsoftonline.com/MY_TENANT_NAME"

    The tenant name for your Azure organization can be obtained by typing "Tenant Status" into the Azure search bar.


    Xamarin: The above note worked for MSAL iOS - for Xamarin MSAL Android/iOS, there was no direct way to set the authority in the main call. It needs to be chained to the interactive login call.

    E.g., the sample code here:

    authResult = await App.PCA.AcquireTokenInteractive(App.Scopes)
                          .WithParentActivityOrWindow(App.ParentWindow)
                          .ExecuteAsync();
    

    Needs to be changed to this:

    authResult = await App.PCA.AcquireTokenInteractive(App.Scopes)
                          .WithAuthority("https://login.microsoftonline.com/YOUR_TENANT_NAME")
                          .WithParentActivityOrWindow(App.ParentWindow)
                          .ExecuteAsync();
    
    0 讨论(0)
  • 2020-12-17 09:08

    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

    0 讨论(0)
  • 2020-12-17 09:13

    Enable multi-tenant using 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)

    0 讨论(0)
  • 2020-12-17 09:25

    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
    
    0 讨论(0)
提交回复
热议问题