Answer the question
In order to leave comments, you need to log in
How to implement SSO on subdomains?
There is one project consisting of several smaller projects. Each project is a web application, all hosted on different subdomains (eg auth.project.local, admin.project.local, portal.project.local etc.). The authorization project uses ASP.NET Identity. How to make it so that you can log in to auth.project.local once and authorization is no longer required for admin and portal. Tried to change cookieDomain - does not help.
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = "ProjectCookie",
LoginPath = new PathString("/"),
CookieName = "AppSession",
CookieDomain = ".project.local",
Provider = new CookieAuthenticationProvider
{
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<UserManager<User, long>, User, long>(
validateInterval: TimeSpan.FromMinutes(10),
regenerateIdentityCallback: (manager, user) => user.GenerateUserIdentityAsync(manager),
getUserIdCallback: id => id.GetUserId<long>()
)
}
Answer the question
In order to leave comments, you need to log in
stackoverflow.com/questions/19166599/asp-net-ident...
Is the config the same everywhere?
Write the full path instead of / in the loginpaf, I myself have not tried it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question