My MVC3 app provides three ways for a user to log on
- Email + Alias
- OpenID Provider
- Username + Password
The first two are for visitors without accounts, allowing them to comment/vote on things; the last is for authors and admin who have db user accounts with elevated privileges. Thus there are two log on forms - one for visitors and one for full users.
Unauthenticated/unauthorized attempts to access a resource are redirected to the login page as standard.
Question:
How might I conditionally redirect these requests to the appropriate? Resources requiring Author/Admin privileges to the full user log on form, and Resources only requiring visitor privileges to the visitors log on form?
Also, might I handle avoiding redirects in the case of an AJAX or partial view call? For instance, I'd like to embed the comments partial view in my entry view, and if they are unauthenticated, not redirect, but simply embed the visitors log on there.
Update: I do not want to maintain 2 Atuhorize attributes.