简体   繁体   中英

Azure AD Cannot hit login.microsoftonline.com/{tenantId}

I am trying to create authentication for my App via Azure Active Directory but have had little luck.

I created a new Azure Active Directory instance in portal.azure.com and copied the "Directory ID" (Click on Azure Active Directory and then properties) and still cannot authenticate.

I am trying to use https://login.microsoftonline.com/ {tenantId}. Any suggestions on what I may be doing wrong or need to try in the portal?

Answer: The above won't work directly by itself.

You must set up OWIN and enable an OWIN startup class.

This is what the startup class should look like:

app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);

        app.UseCookieAuthentication(new CookieAuthenticationOptions());

        app.UseOpenIdConnectAuthentication(
            new OpenIdConnectAuthenticationOptions
            {
             ClientId = "{Registered app object id}", //This value is found in the app configuration page and is app specific
            Authority = "https://login.microsoftonline.com/{tenantId}" //This value will NEVER change as it is the tenant ID
            });

我了解此问题已得到解决,但是我想为其他具有相同问题的人添加更多信息:我的建议是按照本教程中的步骤进行操作, 步骤说明了您需要执行的操作以及在这些字段中添加的内容,例如作为TenantId或ClientId。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM