If I understand, you are trying to share an authentication cookie across multiple ASP.NET applications. Please see the official documentation. Share authentication cookies among ASP.NET apps
User.Identity.IsAuthenticated is always false
I am trying to implement single sign on across subdomains using forms authentication and .net Core 3.1. I have a website called parent.com where user logs in and I want to make sure that when user visits child.parent.com, it should be already logged in. I am able to set the .ASPXAUTH cookie from parent.com, and I can even see that cookie in browser when I visit child.parent.com. However when I use User.Identity.IsAuthenticated, I am always getting false as a response, because of which the site is inaccessible. My web.config is working fine as I am able to see the .ASPXAUTH cookie on child.parent.com. I have referred many stackoverflow questions, Microsoft forums, tutorials and offical docs, but I cannot find the solution. Can someone help me with it I have wasted more than 10 days on this issue and still I have reached nowhere near to the conclusion. Thanks in advance.
Developer technologies | ASP.NET | Other
Microsoft Security | Microsoft Identity Manager
2 answers
Sort by: Most helpful
-
-
Bruce (SqlWork.com) 78,006 Reputation points Volunteer Moderator
2023-04-06T15:22:50.1733333+00:00 You need to share the encryption keys between the sites. See configuration of data protection services. https://learn.microsoft.com/en-us/aspnet/core/security/data-protection/configuration/overview?view=aspnetcore-7.0