c# - OWIN separate login from subdomain -
i'm using owin second site , fine locally i'm having trouble when user signs in on first site mysite.com , goes second.mysite.com , this: error error occurred while processing request. i'm guessing because first site uses same cookies names second. here example of startup.auth like:
public partial class startup { public void configureauth(iappbuilder app) { app.usecookieauthentication(new cookieauthenticationoptions { authenticationtype = defaultauthenticationtypes.applicationcookie, loginpath = new pathstring("/account/signin"), cookiedomain = ".mysite.org", cookiename = "second.mysite.org" }); } } i tried adding cookiename hoping still same error. sum don't want second project use same login first. there older subdomain uses same login first site , don't want this new site.
update: stopped getting these errors when removed antiforgerytoken. setting domain , machine key in web.config didn't solve problem created more problems me.
the cookie name must same, must use same machine key on different servers otherwise cookie not able decrypted other machine:
<system.web> <machinekey decryptionkey="<some long key>" validationkey="<another long key>" /> </system.web> more info: https://msdn.microsoft.com/en-us/library/w8h3skw9%28v=vs.85%29.aspx , setting up: http://www.alexboyang.com/2014/05/28/sso-for-asp-net-mvc4-and-mvc5-web-apps-shared-the-same-domain/
Comments
Post a Comment