Closed bl1nder closed 9 years ago
This is my log with request and parameters. Have any idea , where i'm wrong? Thanks for attention
2014-09-17 15:44:27,736 (GMT+4) [1] INFO DotNetOpenAuth - DotNetOpenAuth.Core, Version=4.3.4.13329, Culture=neutral, PublicKeyToken=2780ccd10d57b246 (official) 2014-09-17 15:44:27,743 (GMT+4) [1] INFO DotNetOpenAuth - Reporting will use isolated storage with scope: User, Domain, Assembly 2014-09-17 15:44:27,764 (GMT+4) [1] DEBUG DotNetOpenAuth.Messaging.Channel - Preparing to send UnauthorizedTokenRequest (1.0) message. 2014-09-17 15:44:27,765 (GMT+4) [1] DEBUG DotNetOpenAuth.Messaging.Bindings - Binding element DotNetOpenAuth.OAuth.ChannelElements.OAuthHttpMethodBindingElement applied to message. 2014-09-17 15:44:27,766 (GMT+4) [1] DEBUG DotNetOpenAuth.Messaging.Bindings - Binding element DotNetOpenAuth.Messaging.Bindings.StandardReplayProtectionBindingElement applied to message. 2014-09-17 15:44:27,766 (GMT+4) [1] DEBUG DotNetOpenAuth.Messaging.Bindings - Binding element DotNetOpenAuth.Messaging.Bindings.StandardExpirationBindingElement applied to message. 2014-09-17 15:44:27,767 (GMT+4) [1] DEBUG DotNetOpenAuth.Messaging.Channel - Applying secrets to message to prepare for signing or signature verification. 2014-09-17 15:44:27,767 (GMT+4) [1] DEBUG DotNetOpenAuth.Messaging.Bindings - Signing UnauthorizedTokenRequest message using HMAC-SHA1. 2014-09-17 15:44:27,774 (GMT+4) [1] DEBUG DotNetOpenAuth.Messaging.Bindings - Constructed signature base string: POST&https%3A%2F%2Fwww.khanacademy.org%2Fapi%2Fauth%2Frequest_token&oauth_callback%3DOAuthCallBack%26oauth_consumer_key%3DUHcvTTkzB9mFXaq4%26oauth_nonce%3DaxuBQpHQ%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1410954267%26oauth_version%3D1.0 2014-09-17 15:44:27,774 (GMT+4) [1] DEBUG DotNetOpenAuth.Messaging.Bindings - Binding element DotNetOpenAuth.OAuth.ChannelElements.SigningBindingElementChain applied to message. 2014-09-17 15:44:27,777 (GMT+4) [1] INFO DotNetOpenAuth.Messaging.Channel - Prepared outgoing UnauthorizedTokenRequest (1.0) message for https://www.khanacademy.org/api/auth/request_token: oauth_consumer_key: UHcvTTkzB9mFXaq4 oauth_nonce: axuBQpHQ oauth_signature_method: HMAC-SHA1 oauth_signature: O5u3FKW6vJrHuKscXpC8q19pRMk= oauth_version: 1.0 oauth_timestamp: 1410954267 oauth_callback: OAuthCallBack
2014-09-17 15:44:27,778 (GMT+4) [1] DEBUG DotNetOpenAuth.Messaging.Channel - Sending UnauthorizedTokenRequest request. 2014-09-17 15:44:27,934 (GMT+4) [1] DEBUG DotNetOpenAuth.Http - HTTP POST https://www.khanacademy.org/api/auth/request_token 2014-09-17 15:44:28,178 (GMT+4) [1] ERROR DotNetOpenAuth.Http - https://www.khanacademy.org/api/auth/request_token returned 401 Unauthorized: Unauthorized 2014-09-17 15:44:28,179 (GMT+4) [1] DEBUG DotNetOpenAuth.Http - WebException from https://www.khanacademy.org/api/auth/request_token:
Sorry, I don't know about the details of the DotNetOpenAuth library. The access_token and request_token URLs look correct, and should be all that you need.
You might be able to get better help by looking at the examples at https://github.com/DotNetOpenAuth/DotNetOpenAuth.Samples or by asking on StackOverflow.
I try to get access to Khan academy. I use DotNetOpenAuth library. and have this error "Expected IProtocolMessage message but received no recognizable message."
this is my Serviceprovider config.
new ServiceProviderDescription { AccessTokenEndpoint = new MessageReceivingEndpoint("https://www.khanacademy.org/api/auth/access_token", HttpDeliveryMethods.PostRequest), RequestTokenEndpoint = new MessageReceivingEndpoint("https://www.khanacademy.org/api/auth/request_token", HttpDeliveryMethods.PostRequest), UserAuthorizationEndpoint = new MessageReceivingEndpoint("https://www.khanacademy.org/api/auth", HttpDeliveryMethods.AuthorizationHeaderRequest | HttpDeliveryMethods.GetRequest), TamperProtectionElements = new ITamperProtectionChannelBindingElement[] { new HmacSha1SigningBindingElement() }, ProtocolVersion = ProtocolVersion.V10 };
I dont understand which url i should use in UserAuthorizationEndpoint property. Thank you.