I have this on my 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);
}
}
}
and I have this 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
});
}
}
}
Howevver it does not compile with this error:
I use the code from this page http://tech.trailmax.info/2016/03/using-owin-and-active-directory-to-authenticate-users-in-asp-net-mvc-5-application/
Easy, but hard to find, the problem is another developer created a startup.cs file with same signature in a different folder in the project structure. Will leave evidence here because it might be useful for another developer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With