OWIN Cookie身份验证 - 相当于FormsAuthentication.CookieName?

时间:2014-10-14 00:52:39

标签: c# asp.net asp.net-mvc forms-authentication owin

我正在使用带有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设置它并以这种方式检索它。

0 个答案:

没有答案