Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Signature Invalid problem while trying to get a request_token

336 views
Skip to first unread message

Prema Ramasamy

unread,
Apr 6, 2010, 2:19:50 PM4/6/10
to OAuth Java
It is taking quite a bit of time to nail down this issue...If I am
missing something obvious, let me know..

My call to get a request token fails...I am testing both the provider
and consumer on localhost..

On the CONSUMER end ..I do this..
-----------------------------------------------------------------------------------------------------------------------------------
Properties consumerProperties = new Properties();
OAuthConsumer consumer;
consumerProperties.load(in);
ConsumerProperties consumers = new
ConsumerProperties(consumerProperties);

consumer = consumers.getConsumer(consumerName);

OAuthAccessor accessor = new OAuthAccessor(consumer);

java.util.Collection<OAuth.Parameter> parameters = null;

URL baseURL = (URL)
accessor.consumer.getProperty("serviceProvider.baseURL");

OAuthMessage request = accessor.newRequestMessage("POST", (new
URL(baseURL, "echo")).toExternalForm(), parameters); //what is this
echo for anyway ?

-----------------------------------------------------------------------------------------------------------------------------------------------------------
the request contains the following params.... after the above code....

oauth_consumer_key from consumer: myConsumerKey
oauth_consumer_key from request: myConsumerKey
oauth_signature_method : HMAC-SHA1
oauth_timestamp : 1270576575
oauth_nonce : 244779113802312
oauth_version : 1.0
oauth_signature : BYz7M0C4fKoFUTZjlyBDbUp8qXI=

--------------------------------------------------------------------------------------------------------------------------------------------------------------

On the PROVIDER end ..I do this..

-----------------------------------------------------------------------------------------------------------------------------------

OAuthMessage requestMessage = OAuthServlet.getMessage(request, null);
OAuthConsumer consumer = OAuthProvider.getConsumer(requestMessage);
OAuthAccessor accessor = new OAuthAccessor(consumer);

OAuthProvider.VALIDATOR.validateMessage(requestMessage, accessor);

--------------------------------------------------------------------------------------------------------------------------------------------------------------

and I am bounced back with a signature invalid error.

net.oauth.OAuthProblemException: signature_invalid
at
net.oauth.signature.OAuthSignatureMethod.validate(OAuthSignatureMethod.java:
68)
at
net.oauth.SimpleOAuthValidator.validateSignature(SimpleOAuthValidator.java:
254)
at
net.oauth.SimpleOAuthValidator.validateMessage(SimpleOAuthValidator.java:
148)

If there is something very obvious that I am messing up with , let me
know.

Prema Ramasamy

unread,
Apr 7, 2010, 1:39:52 PM4/7/10
to OAuth Java
I fixed it myself. Like it was said in the other posts, debugging
would have been much easier , if the library can print more info ..
(like..base string used..) when there is a signature mismatch. If we
spend too much time looking thru the library code to see where and why
it could have gone wrong, the whole purpose of using the library would
be gone. Small polishes here and there would make it more useful
IMHO.

Prema.

Prasad Mutha

unread,
Jun 9, 2015, 6:13:20 AM6/9/15
to oauth...@googlegroups.com
Hi,
could u  tell me where we need to fix this?
I am also facing the same issue, but couldn't find the way out.
Thank You in advance.
Reply all
Reply to author
Forward
0 new messages