If you want to dynamically intercept and re-authenticate someone who has already authenticated, you can probably also handle this with a special cookie. Actions requiring re-authorization can be decorated with a custom filter that overrides OnAuthorization to check the cookie, and then redirect its username and password if it is not found. Template, without code:
User clicks link to uber-protected action. Filter on action looks for cookie and does not find it, redirects to sign in. User signs in, and you write a special cookie (different from the forms auth cookie), then redirect back to original action. Filter on action looks for cookie and finds it authorizing user.
At least the cookie lifetime should go all the way to the secure object's http message. You will need to decide when to remove it. For example, after re-authorizing a user for one uber-protected action, do you want them to re-authorize for a second uber-protected action in the same browser session?
source share