Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authorize attribute not working MVC 5

I have separated the Models into Specific project

After that MVC default [Authorize] attribute not working in my application

When i try to login the application it is not login the application nor it is redirecting to the specific page

like image 289
Arul Prasanth Avatar asked Oct 14 '14 13:10

Arul Prasanth


2 Answers

Check if you have removed the forms authorization module. Some of the new templates remove forms authorization by default. If it has been removed, comment it out. It will look like this in your web.config:

<remove name="FormsAuthentication" />

I found this question looking for a very similar error, so I thought it would be good to post my solution.

like image 160
Dylan Avatar answered Sep 25 '22 09:09

Dylan


Do you have something like this

<authentication mode="Forms">
 <forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>

in your web.config?

like image 37
Marius B. Avatar answered Sep 23 '22 09:09

Marius B.