I have an ASP.NET MVC application. This application has a controller that does not have any attributes on it. This controller has a fairly complex action. Up-to-this point, the action has had [AllowAnonymous] on it. Due to its complexity, I want to share this action with both Authorized and Unauthorized users. In the event of an Authorized user, I'm going to add one basic piece to this complex action.
I tried adding [Authorize] as suggested in this post. However, no matter what, User.Identity.IsAuthenticated is always false. I have my own membership database structure. However, I've tied it into the System.Web.Security stuff. So, when someone logs in, I have:
FormsAuthentication.SetAuthCookie(model.Username, model.RememberMe);
This has worked fine up to this point.
How do I allow both authorized and unauthorized users to access a controller action, while identifying if the user is authorized or not? Thank you!
System.Web.Securitystuff, are you sure this is being set properly?