According to the OAuth spec a 400 occurs when a Service Provider rejects a
Consumer Request. Some of the examples they outline are Unsupported
parameter, Unsupported signature method, Missing required parameter, ...
Since the code is working against another provider I'd consult the doc for
this specific provider to see what they expect (i.e. maybe they only support
PLAINTEXT signatures). If the service provider sends error info back in the
response, you can change your code as follows to get some additional data.

try {
  client.getRequestToken(accessor);
}catch(OAuthProblemException e) {
  System.err.println(e.getParameters());
  throw e;
}

HTH,
Rob

On Tue, Feb 16, 2010 at 4:25 PM, dj <[email protected]> wrote:

> Hi,
>
> I'm trying to use oauth on Android, going along with this excellent
> tutorial on how to do it:
>
>  http://donpark.org/blog/2009/01/24/android-client-side-oauth
>
> it works for twitter. Now I just replaced the urls, key and secret, to
> point to a different third party OAuth service I want to use. I get
> the following exception thrown:
>
> net.oauth.OAuthProblemException: HTTP/1.1 400 Bad Request
>  at net.oauth.client.OAuthClient.invoke(OAuthClient.java:257)
>  at net.oauth.client.OAuthClient.invoke(OAuthClient.java:160)
>  at net.oauth.client.OAuthClient.getRequestToken(OAuthClient.java:
> 101)
>  at net.oauth.client.OAuthClient.getRequestToken(OAuthClient.java:77)
>  at net.oauth.client.OAuthClient.getRequestToken(OAuthClient.java:
> 110)
>
> Here's the code I'm using:
>
> OAuthServiceProvider provider = new OAuthServiceProvider(
>  urlRequestToken,
>  urlAccessToken,
>  urlAuthorize);
>
> OAuthConsumer consumer = new OAuthConsumer(
>  urlCallback,
>  consumerKey,
>  consumerSecret, provider);
> OAuthAccessor accessor = new OAuthAccessor(consumer);
> OAuthClient client = new OAuthClient(new HttpClient4());
>
> // Exception:
> client.getRequestToken(accessor);
>
> I'm sure my key and secret are correct, and my urls are pointing to
> the correct locations. Is the third party implementation of OAuth
> (server-side) the cause of this? It is working for twitter and linked-
> in. Any ideas would be great,
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "OAuth" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected] <oauth%[email protected]>.
> For more options, visit this group at
> http://groups.google.com/group/oauth?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"OAuth" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/oauth?hl=en.

Reply via email to