Posted on: 5/24/2011 10:06:46 AM | Views : 857

HI everyone.
 
How can I implement Principal.GenericIdentity on MVC 3 project.
 
I have a Model (login) with username and password properties and a methods (isValidUser)
I have a view (type of my model "login") and a Controller (Guest) with 2 methods, index (here I load my view) and (login, here I check with my model if the user is valid).
Until that everything is OK, but then on Login method I try to set an "Principal identity". If I call to another method from here I can "restrict" access using  <Authorize(Roles:="admin")> but when I make another request from another view for example the role,username and all of that it doesn't exist anymore and the restriction over the method doesn't work (or permissions)
<HttpPost()> Function Login(ByVal usuarioLogin As guest.login) As ActionResult If (usuarioLogin.validarUsuario) Then Dim identi ...

Go to the complete details ...