I'm trying to get OAuth working. My gadget is calling makeRequest() with
OAUTH authentication. When the request gets to my server all of the
OAuth parameters are there. But, when I try to validate, I get an
exception:
net.oauth.OAuthProblemException: signature_invalid
at
net.oauth.signature.OAuthSignatureMethod.validate(OAuthSignatureMethod.j
ava:67)
at
net.oauth.SimpleOAuthValidator.validateSignature(SimpleOAuthValidator.ja
va:103)
at
net.oauth.SimpleOAuthValidator.validateMessage(SimpleOAuthValidator.java
:68)
Here's my validation code:
public boolean isValidOAuthQuery(OAuthConsumer consumer,
HttpServletRequest request)
{
String requestURL = OAuthServlet.getRequestURL(request);
OAuthMessage message = OAuthServlet.getMessage(request,
requestURL);
OAuthAccessor accessor = new OAuthAccessor(consumer);
SimpleOAuthValidator validator = new SimpleOAuthValidator();
try
{
validator.validateMessage(message, accessor);
}
catch ( Exception e )
{
e.printStackTrace();
return false;
}
return true;
}
Jordan Zimmerman
Principal Software Architect
831.647.4712
831.214.2990 (cell)
jordanz@shop.com
SHOP*COMTM
All your favorite stores.
OneCart(r) convenience.
www.shop.com
This message (including any attachments) is intended only for
the use of the individual or entity to which it is addressed and
may contain information that is non-public, proprietary,
privileged, confidential, and exempt from disclosure under
applicable law or may constitute as attorney work product.
If you are not the intended recipient, you are hereby notified
that any use, dissemination, distribution, or copying of this
communication is strictly prohibited. If you have received this
communication in error, notify us immediately by telephone and
(i) destroy this message if a facsimile or (ii) delete this
message
immediately if this is an electronic communication.
Thank you.
|