Automatic User Authentication Framework for Controllers in ASP.NET MVC?

Posted by Austin on Stack Overflow See other posts from Stack Overflow or by Austin
Published on 2010-06-09T20:49:45Z Indexed on 2010/06/09 20:52 UTC
Read the original article Hit count: 221

In rails I could do something like this to make sure a user is authenticated before accessing an action in the controller:

before_filter :checked_logged_in, :only => [:edit, :update]

I was wondering if ASP.NET MVC had something similar or if there was a framework out there that could essentially do something like the following:

For certain methods with actions that take a certain parameter, I want to point the action to a method, check to see if the user owns that object, and if so, proceed to the controller action. If not, I want to redirect him to another action where I can show him he has invalid credentials.

So basically I am looking for a sort of "before_filter." Anyone know of anything out there that can do this? Thanks!

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-mvc