I have tried having a azure sso login in my existing application using the following link (https://learn.microsoft.com/en-us/azure/active-directory/develop/web-app-quickstart?pivots=devlang-aspnet).
When i implemet it the normal login was not working. Since the cookie authentication used by default on startup.cs cause the following issue.
Can anyone let me know if this is possible in asp.net mvc?.
I have reviewed all but i doesn't have any proper documentation or solution to fix this on asp.net mvc. Since all solution includes asp.net core.
Could someone help me out on this?
i have tried replacing the usecookieauthentication which was generated by default with the usecookieauthentication which was given in the microsoft azure sso documentation.
i replaced
app.UseCookieAuthentication(new CookieAuthenticationOptions());
with
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
Provider = new CookieAuthenticationProvider
{
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
validateInterval: TimeSpan.FromMinutes(30),
regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager)),
OnResponseSignIn = context =>
{
context.Properties.IsPersistent = false;
context.Properties.AllowRefresh = true;
context.Properties.ExpiresUtc = DateTimeOffset.UtcNow.AddMinutes(timeoutInMinutes);
}
},
SlidingExpiration = true
});
Yes, we can do normal login and azure ad sso login in asp Dot net mvc Follow the below steps to achieve this Create an MVC App with Microsoft Identity Platform Authentication Select the dependency services
Able to logon with SSO ADO Login Normal Login: For normal login users need to choose another account as shown in the below screenshot and have to enter the credentials