0

We are using DotNetOpenAuth for both a TokenProvider and a Client application. We are using DotNetOpenAuth version 4.3.4. We are using OAuth version 1.0

The client application is making a request to https://myTokenProvider/GetRequestToken and receiving a 500 internal server error.

I go to the logs on the TokenProvider and I have getting the following messages in the logs:

2015-03-27 23:04:06,395 (GMT-4) [9] INFO DotNetOpenAuth.Messaging.Channel - Scanning incoming request for messages: http://myTokenProvider/GetRequestToken

2015-03-27 23:04:06,395 (GMT-4) [9] DEBUG DotNetOpenAuth.Messaging.Channel - Incoming request received: UnauthorizedTokenRequest

2015-03-27 23:04:06,395 (GMT-4) [9] INFO DotNetOpenAuth.Messaging.Channel - Processing incoming UnauthorizedTokenRequest (1.0.1) message:

oauth_callback: https://myClientApplication/Account/Login?returnUrl=https%3a%2f%2fmyClientApplication%2fhome%2f

oauth_consumer_key: myKeyHere

oauth_nonce: HhdkQHQX

oauth_signature_method: HMAC-SHA1

oauth_signature: e7q4Sc10Ju/6mEED3vHSEMwVewo=

oauth_version: 1.0

oauth_timestamp: 1427511846

2015-03-27 23:04:06,395 (GMT-4) [9] DEBUG DotNetOpenAuth.Messaging.Bindings - Verifying incoming UnauthorizedTokenRequest message signature of: e7q4Sc10Ju/6mEED3vHSEMwVewo=

2015-03-27 23:04:06,395 (GMT-4) [9] DEBUG DotNetOpenAuth.Messaging.Channel - Applying secrets to message to prepare for signing or signature verification.

2015-03-27 23:04:06,411 (GMT-4) [9] DEBUG DotNetOpenAuth.Messaging.Bindings - Constructed signature base string: POST&http%3A%2F%2FmyTokenProvider%2FGetRequestToken&oauth_callback%3Dhttps%253A%252F%252FmyClientApplication%252FAccount%252FLogin%253FreturnUrl%253Dhttps%25253a%25252f%25252fmyClientApplication%25252f%2526returned%253Dtrue%26oauth_consumer_key%3DmyKeyHere%26oauth_nonce%3DHhdkQHQX%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1427511846%26oauth_version%3D1.0

2015-03-27 23:04:06,411 (GMT-4) [9] ERROR DotNetOpenAuth.Messaging.Bindings - Signature verification failed.

2015-03-27 23:04:06,411 (GMT-4) [9] ERROR HandleErrorWithLoggingAttribute - Managed Application Error

DotNetOpenAuth.Messaging.Bindings.InvalidSignatureException: Message signature was incorrect.

at DotNetOpenAuth.OAuth.ChannelElements.SigningBindingElementBase.ProcessIncomingMessage(IProtocolMessage message)

at DotNetOpenAuth.OAuth.ChannelElements.SigningBindingElementChain.ProcessIncomingMessage(IProtocolMessage message)

at DotNetOpenAuth.Messaging.Channel.ProcessIncomingMessage(IProtocolMessage message)

at DotNetOpenAuth.Messaging.Channel.ReadFromRequest(HttpRequestBase httpRequest)

at OAuthManager.GetAuthorizationToken(String oauthUri)

at Controllers.AccountController.GetRequestToken()

at lambda_method(Closure , ControllerBase , Object[] )

at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)

at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)

at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass42.b__41()

at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.b__33()

at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.b__49()

at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.b__49()

at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.b__36(IAsyncResult asyncResult)

at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<>c__DisplayClass2a.b__20()

at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.b__22(IAsyncResult asyncResult)>

Can someone please help me figure out why the Signature verification is failing?

This was working previously and now it is not. I can't figure out what has changed, or why it stopped working.

Thanks!

jkruer01
  • 2,175
  • 4
  • 32
  • 57
  • So, I found this post: http://stackoverflow.com/questions/6091268/dotnetopenauth-message-signature-was-incorrect?rq=1 – jkruer01 Mar 28 '15 at 04:33
  • After looking further into the logs on both the client and the token provider, I saw both were posting logs about "Constructed signature base string:". When I compare the value on the client with the value on the token provider, they are identical EXCEPT the client has HTTPS and the token provider has HTTP without the S. I am pretty sure that SSL termination is taking place. Is this what is causing the error? Is there anyway around this? Thanks! – jkruer01 Mar 28 '15 at 04:35

0 Answers0