I have ASP.Net MVC 5 using the Identity Framework and OWIN to allow users to sign in via OAuth.
Specifically I'm currently working on authenticating against Twitter, and I'd like to add force_login=true
so that users are able to choose which account to use, rather than being automatically authenticated with the account they're already signed in to twitter with.
I've tracked down this code which appears to construct the URL and as far as I can see offers no points at which I can modify the URL.
Microsoft.Owin.Security.Twitter/TwitterAuthenticationHandler.cs
The class is internal in an Microsoft assembly so the only option I can see available is to copy that class and all required supporting code, then manually keep it in sync with the original if they make changes.
Is there another approach that I'm missing?
I would really rather avoid creating a maintenance nightmare if it can be avoided.
You can hook into Options.Provider.ApplyRedirect(redirectContext) and it will be called from ApplyResponseChallengeAsync.