Last post May 14, 2018 02:45 AM by Nan Yu
May 10, 2018 11:33 AM|McElie_MasterPiece_Dev|LINK
I'm really frustrated. I'm currently developing an MVC5 web application with the User Authentication. But I was request to Add the Office 365 User Acces.
I did uncomment the following and add my real description accordingly
However when the User Logs In the Web application from the Login Page, there is the following error appearing and Breaking the process:
Please anyone may help me ASAP as it's Urgent.
May 11, 2018 07:56 AM|Nan Yu|LINK
Hi McElie ,
To use ASP.NET Ideitity with Azure AD authentication , please refer to below steps :
public void ConfigureAuth(IAppBuilder app)
// Configure the db context, user manager and signin manager to use a single instance per request
// Enable the application to use a cookie to store information for the signed in user
// and to use a cookie to temporarily store information about a user logging in with a third party login provider
// Configure the sign in cookie
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
Provider = new CookieAuthenticationProvider
// Enables the application to validate the security stamp when the user logs in.
// This is a security feature which is used when you change a password or add an external login to your account.
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
// Enables the application to temporarily store user information when they are verifying the second factor in the two-factor authentication process.
// Enables the application to remember the second login verification factor such as phone or email.
// Once you check this option, your second step of verification during the login process will be remembered on the device where you logged in from.
// This is similar to the RememberMe option when you log in.
// Uncomment the following lines to enable logging in with third party login providers
// clientId: "",
// clientSecret: "");
// consumerKey: "",
// consumerSecret: "");
// appId: "",
// appSecret: "");
// ClientId = "",
// ClientSecret = ""
ClientId = "YourClientID",
Authority = "https://login.microsoftonline.com/yourdomain.onmicrosoft.com",
Then when clicking "Login" button in web application , you can choose the identity provide :
May 11, 2018 09:22 AM|McElie_MasterPiece_Dev|LINK
Hi Nan Yu,
I'm Excited to read you, However, my application just can't stop Realoading at the OpenIdConnect Login, just after the user fills up is details.
I have Run a Diagnostic. And I have found out that it's break from here:
string authority = String.Format(CultureInfo.InvariantCulture, aadInstance, tenant);
user Startup.Auth.cs Class
Then by the Next Run, It's just runs without Breaks but this time it's just reload couless times without hand.
The Web browser it's stack here:
How would I stop the reload process and get to the Home page after Log in the Azure AD authentication
Very Disturb and frustrate.
Please reply ASAP or should I Escalate the Request to the High Level Urgent?!
The company user's need to login and use the system, but the O365 login is not working.
Please Help ASAP
May 14, 2018 02:45 AM|Nan Yu|LINK
I haven't face your problem, are you using ASP.Net Identity and have you customize the identity system ? Have you set correct tenant/app id/redirect url of your AAD app in MVC application ?