[oauth] Re: 400 Bad Request?

2010-02-18 Thread dj
Hi Robert,

Thanks for the information. I do get some information printed from the
caught OAuthProblemException. It is printed below. Looks like
something related to the timestamp being refused? I tried searching
for the timestamp refused error, and it seems like you're supposed to
be setting the current time in the oauth client somehow, I don't know
if that's true, or if it is, where would we do that?:


HTTP response: HTTP/1.1 400 Bad Request
Server: nginx/0.7.64
Date: Thu, 18 Feb 2010 18:56:17 GMT
Content-Type: text/plain; charset=utf-8
Connection: keep-alive
Content-Length: 70
X-Lift-Version: 2.0-M2

TIMESTAMP_REFUSED (oauth_acceptable_timestamps: 1266519077-1266519677)
URL:
http://thesite.com/oauth/request_token?oauth_consumer_key=xoauth_signature_method=HMAC-SHA1oauth_timestamp=1266530170oauth_nonce=71507272567oauth_version=1.0oauth_signature=ulBLMuMJP%2Be0a8M9d2WM6HruDa0%3D
HTTP request: GET /oauth/request_token?
oauth_consumer_key=xoauth_signature_method=HMAC-
SHA1oauth_timestamp=1266530170oauth_nonce=71507272567oauth_version=1.0oauth_signature=ulBLMuMJP
+e0a8M9d2WM6HruDa0=


Thanks



On Feb 16, 3:09 pm, Robert Winch rwi...@gmail.com wrote:
 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 dj.am.juice...@gmail.com 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 oa...@googlegroups.com.
  To unsubscribe from this group, send email to
  oauth+unsubscr...@googlegroups.com oauth%2bunsubscr...@googlegroups.com.
  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 oa...@googlegroups.com.
To unsubscribe from this group, send email to 
oauth+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/oauth?hl=en.



[oauth] 400 Bad Request?

2010-02-16 Thread dj
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 oa...@googlegroups.com.
To unsubscribe from this group, send email to 
oauth+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/oauth?hl=en.