Lui*_*cia 5 c# asp.net asp.net-mvc owin
我在我的startup.cs上有这个
using Microsoft.Owin;
using Owin;
[assembly: OwinStartupAttribute(typeof(xx.yy.Startup))]
namespace xx.yy
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
}
}
}
Run Code Online (Sandbox Code Playgroud)
我有这个Startup.Auth.cs
using System;
using Microsoft.Owin;
using Microsoft.Owin.Security.Cookies;
using Owin;
namespace xx.yy
{
public static class xxAuthentication
{
public const String ApplicationCookie = "xxAuthenticationType";
}
public partial class Startup
{
public void ConfigureAuth(IAppBuilder app)
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = xxAuthentication.ApplicationCookie,
LoginPath = new PathString("/Login"),
Provider = new CookieAuthenticationProvider(),
CookieName = "ComisionesCookie",
CookieHttpOnly = true,
ExpireTimeSpan = TimeSpan.FromHours(12), // adjust to your needs
});
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是它不能用这个错误编译:
| 归档时间: |
|
| 查看次数: |
1493 次 |
| 最近记录: |