-
Notifications
You must be signed in to change notification settings - Fork 32
Description
I tried to use this library in a brand new MVC 4 project (Internet template) on .Net 4.5 and using VS 2012. I followed the directions and added all items necessary. I copied and fixed up the controllers, views, viewmodels, and Repository items from the sample project into this new project. Nothing security related would work. I couldn't log in.
I traced into the AppHarbor.Web.Security.CookieAuthenticationModule and at the OnAuthenticateRequest method, there would be no '.APSXAUTH' cookie. All of the other cookies I added would appear but not that one, and so authentication never worked. I changed the name of the authentication cookie in the web.config, and then that cookie no longer appeared in the OnAuthenticateRequest method. It was as if something was consuming the cookie before it got to the module.
I tried various ways of getting around the issue and in the end found that the issue is something within the MVC 4 Internet Template. I am assuming that there is another step that has to occur, such as removing the SimpleMembershipProvider. I did not figure out what needed to change. Using the "Basic" template with MVC 4 and .net 4.5 and this library worked just fine.
This is not a bug in the library, but maybe some more guidance can be listed regarding using this authentication method and the Internet template for MVC4. Several hours wasted tracking this down, so hopefully someone with more experience with how MVC4, SimpleMembershipProvider, etc. can write the other steps that need to be taken if using this with the new "Internet" template.