disable AskUser in OpenId Provider
-
30-06-2021 - |
题
I create OpenId Provider by DotNetOpenAuth Library.
I use OpenIdProviderMvc project that found on sample of DotNetOpenAuth and customized it.
Now I have 2 question:
- How can I remove AskUser step?
- How can i signout in provider after response to RP?
解决方案
Skipping the ask user step is as easy as changing the OpenIdController.ProcessAuthRequest method so that instead of redirecting to the AskUser action, it always (effectively) follows the path as if AutoRespondIfPossible
returned true.
You can effectively sign the user out "after" response to RP by clearing the cookie in the same redirect instruction to the browser. So before returning from the ProcessAuthRequest
method, try:
FormsAuthentication.SignOut();
If that doesn't work, you may have to do the cookie manipulation yourself as described in this question.
不隶属于 StackOverflow