Search code examples
authenticationcross-domainasp.net-identity-2

Asp.net Identity (MVC 5) cross subdomain login and application pool identity


I used the the method introduced in ASP.NET Identity Cookie across subdomains to implement cross sub-domain sign-in.

For example, I have two sites: account.mydomain.com and www.mydomain.com. Users who logged in the account.mydomain.com, also logged in www.mydomain.com.

However, there is a strange problem: I must change the "application pool identity" to "NetworkService" or "LocalSystem" other than default "ApplicationPoolIdentity". Or, even if someone logged in the account.mydomain.com, he can not login www.mydomain.com.

I wonder what the reason is, and whether this is a problem that change the identity to NetworkService?

Thanks a lot!


Solution

  • Set same MachineKey in all sub domains.