Disclaimer: This is my first time with ASP.NET MVC 5
I have no idea why this is not working. I cannot force my MVC5 application to allow users. I did this in previous versions (2, 3, and 4), but I can't get it to work in OWIN.
I am using local IIS with features enabled:

EDIT :
I use SSL for IIS and RequireHttps in C #
This is the code:
protected void Application_Start() { GlobalFilters.Filters.Add(new AuthorizeAttribute()); }
Startup.Auth.cs
app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, LoginPath = new PathString("/admin/account/login") }); app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie); app.UseGoogleAuthentication();
Despite the fact that I use Global Authorize, I tried to "get" him to see if this problem was:
public class HomeController : Controller { [Authorize] public ActionResult Index() { return View(); } }
No luck ... I'm not sure if this was necessary with OWIN, but I even tried to enable forms authorization:
<authentication mode="Forms" />
EDIT [2]
Ok, I figured out the problem ... IIS! Finally! Now, does anyone know how to fix this? Do I need anything special to run OWIN IIS? Now I can work, but soon I will have to deploy the application and probably encounter the same problem on the server ...
I had read:
How do you log in / authenticate a user with the RTM bits of Asp.Net MVC5 using AspNet.Identity?
Authorize attribute does not work MVC 5
Any ideas?
c # authorization asp.net-mvc-5 owin
eestein
source share