I am trying to set up simple Oauth2 login authentication. However, I am stuck in a callback that throws the following exception:
[ProtocolException: Unexpected OAuth authorization response received with callback and client state that does not match an expected value.] DotNetOpenAuth.Messaging.ErrorUtilities.VerifyProtocol(Boolean condition, String unformattedMessage, Object[] args) +426 DotNetOpenAuth.OAuth2.WebServerClient.ProcessUserAuthorization(HttpRequestBase request) +771
The exact problem is discussed here.
In my case, the SessionID remains unchanged, but the DotNetOpenAuth.WebServerClient.XSRF-Session cookie changes its value on the callback.
Implementation:
public void Authorize(HttpRequest request) { string callbackString = request.Url.AbsoluteUri; Uri callbackUri = new Uri(callbackString);; IAuthorizationState authorization = nimbleClient.ProcessUserAuthorization(); if (authorization == null) {
Lucas bol
source share