Steve
Steve

Reputation: 6424

"Error while reading message" when trying to obtain an OAuth request token

I'm trying to develop a desktop application to access an API exposed by Groundspeak for geocaching.com. The API requires the use of OAuth.

After finally figuring out why my message signature was being rejected (I had to double-encode my callback URL, after reading somewhere that double-encoding causes problems), I now receive the following error from Groundspeak when attempting to get a request token:

oauth_error_message=Error%20while%20reading%20message%20%27DotNetOpenAuth.OAuth.Messages.UnauthorizedTokenRequest%27%20parameter%20%27oauth_callback%27%20with%20value%20%27http%253A%252F%252Fwww.mysite.com%252F%27.

Not a very descriptive error message. What's the problem here? Groundspeak uses DotNetOpenAuth on its server. Seems like my callback URL might be causing some issue, but I don't have any idea what.

I should probably also say that I'm developing a desktop application, so the callback URL isn't really valid. It does point to a website I own, but that website has no idea about OAuth at all. If I omit the callback URL, I receive the error "Callback URL not present or not valid" or somesuch.

Upvotes: 5

Views: 234

Answers (2)

UT-Fan-05
UT-Fan-05

Reputation: 426

This is definitely something that needs to be further defined in the future: OAuth for non-web applications. But there does seem to be a few possible solutions (not the cleanest) that you can try to get OAuth working within a desktop application. You can look into the articles below that have some working solutions (I have not tested this myself). It's based off of Google's workable solution for handling OAuth from installed desktop apps:

https://developers.google.com/accounts/docs/OAuthForInstalledApps

Link to possible workaround solutions:

http://blog.appharbor.com/2012/06/21/oauth-for-net-desktop-applications

Here's also a related article on SO for desktop app OAuth: OAuth for Desktop apps?

Hope this helps!

Upvotes: 0

Mikko Rantalainen
Mikko Rantalainen

Reputation: 15915

I don't know anything about Groundspeak but I'd guess that they require that you register your app's callback URL before using OAuth. At least Google and Microsoft do this with their OAuth APIs. Look for some kind of developer settings on Groundspeak.

Upvotes: 1

Related Questions