我正在使用带有OWIN应用程序的新ASP.NET身份2。我的代码看起来与此类似:
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/"),
CookieDomain = "mysite.local",
CookieName = "MySite.SSO",
SlidingExpiration = true,
ExpireTimeSpan = new TimeSpan(1, 0, 0, 0)
});
之前我使用FormsAuthentication时,如果我想检索cookie的名称或域名,我会做类似的事情:
FormsAuthentication.CookieName
FormsAuthentication.CookieDomain
等
与我如何配置应用程序相比,这相当于什么?我真的不想通过Web.config
设置它并以这种方式检索它。