Thanks
as far as I know, 2-legged OAuth is NOT standardized, and it simply
means that the token exchange phase (the "dance") is skipped. Instead,
an empty token is sent, and it's the responsibility of the service
provider to authenticate the consumer using the consumer key (and the
signature generated using the consumer secret).
I haven't tested Signpost in 2-legged scenarios, but what you may want
to try is this:
// do not set a token or token secret on this consumer
consumer.setSendEmptyTokens(true);
consumer.sign(request);
request.send();
please let me know if that works for you.
So your suggestion is:-
OAuthConsumer consumer = new
DefaultOAuthConsumer(CONSUMER_KEY,
CONSUMER_SECRET);
Replace the following statement :-
consumer.setTokenWithSecret(ACCESS_TOKEN,
TOKEN_SECRET);
with the statement:-
consumer.setSendEmptyTokens(true);
// create an HTTP request to a protected resource
URL url = new URL("http://example.com/protected");
HttpURLConnection request = (HttpURLConnection)
url.openConnection();
// sign the request
consumer.sign(request);
// send the request
request.send();
Hope I got you right.
Thanks
> > Thanks- Hide quoted text -
>
> - Show quoted text -
Yes that looks about right
> as far as I know, 2-legge...
> > Thanks- Hide quoted text -
>
> - Show quoted text -
--
You received this message because you are subscribed to the Google Groups "Signpost users" grou...