【发布时间】:2013-11-28 10:10:56
【问题描述】:
是否可以在 web.config 文件中指定一些选项?创建新项目时,默认情况下您会获得此启动类,并且旧的表单身份验证部分是 web.config 已消失。
// For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
public void ConfigureAuth(IAppBuilder app)
{
// Enable the application to use a cookie to store information for the signed in user
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login")
});
// Use a cookie to temporarily store information about a user logging in with a third party login provider
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
}
我希望能够在此处列出的 CookieAuthenticationOptions 上指定一些选项:
在 web.config 中(例如过期超时)。
【问题讨论】:
标签: asp.net-mvc authentication asp.net-mvc-5 owin