c# - Owin use external forms authentication cookie -
so think issue going have 1 mvc website using standard forms authentication , 1 mvc geared more towards asp.net identity.
what trying configure owin authentication read , accept auth cookie generated standard mvc forms auth site. configured below can't seem owin accept cookie.
app.setdefaultsigninasauthenticationtype(defaultauthenticationtypes.externalcookie); app.usecookieauthentication(new cookieauthenticationoptions { authenticationtype = defaultauthenticationtypes.externalcookie, authenticationmode = authenticationmode.active, loginpath = new pathstring("/account/login"), cookiehttponly = true, cookiename = "myauthcookie", cookiedomain = ".mydomain.com", cookiepath = "/", provider = new cookieauthenticationprovider { // enables application validate security stamp when user logs in. // security feature used when change password or add external login account. onvalidateidentity = securitystampvalidator.onvalidateidentity<applicationusermanager, applicationuser>( validateinterval: timespan.fromminutes(30), regenerateidentity: (manager, user) => user.generateuseridentityasync(manager)) } });
what trying accomplish not possible. cookie authentication middleware claims-based , serializes claims associated identity authentication ticket in cookie. forms authentication stores user name , additional data knows nothing claims. basically, authentication ticket put inside cookie different in both cases , not able cookie authentication middleware read ticket created fam or vice versa.
Comments
Post a Comment