I need to redirect users to the "Change Password" page if their password has expired.
I want to place this code in one place so that any request can be redirected to the password change page.
I reviewed the AuthorizeAttribute extension and the OnActionExecuting override, but don't work / don't let me short-circuit the routing logic to redirect to the password change page.
For a little explanation, the logic will be:
Unauthorized request:
-> any URL → AuthorizeAttribute → Login.aspx → password expiration → ChangePassword.aspx
Authorized request:
-> any URL → ??????? → ChangePassword.aspx
What's this???? what i'm not sure what to do.
I think I'm going to expand the AuthorizeAttribute extension. I will use this everywhere except the password change controller methods.
redirect authorization asp.net-mvc routes
Will
source share