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
});
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.