Open GoogleCodeExporter opened 9 years ago
Hi there. I've updated the following sample to use V1.35.1 of the Java client:
http://oauthexample.appspot.com/Welcome
You can also view the source here:
http://code.google.com/p/googleappengine/source/browse/#svn/trunk/java/demos/oau
th
Using that sample I was able to log into YouTube using OAuth RSA. Can you
compare
and let me know if you have issues? If you do have issues, it'd help to see
how your
code differs from the code in the sample. Thanks!
Original comment by mon...@gmail.com
on 25 Aug 2009 at 4:06
I rollback to gdata-samples.java-1.31.1 and my code works.
What is the part of the sample ?
../demos/oauth/ReceiveTokenControllerServlet.java ?
Here my code :
GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();
oauthParameters.setOAuthSignatureMethod("RSA-SHA1");
oauthParameters.setOAuthConsumerKey(myConsumerKey);
OAuthRsaSha1Signer signer = new OAuthRsaSha1Signer(RsaKeyUtil.getPrivateKey());
GoogleOAuthHelper oauthHelper = new GoogleOAuthHelper(signer);
oauthHelper.getOAuthParametersFromCallback(request.getQueryString(),
oauthParameters);
String accessToken = oauthHelper.getAccessToken(oauthParameters);
This code works with picasa and youtube for gdata-samples.java-1.31.1, but only
picasa for gdata-samples.java-1.35.1. Maybe is the signature method (RSA-SHA1
VS
HMAC), i don't know, it's the only diff.
Original comment by denis.go...@gmail.com
on 25 Aug 2009 at 5:27
There weren't many changes introduced to the OAuth library between 1.31.1 and
1.35.1.
The biggest changes is that the RSA Signer added support for different private
key
formats (byte array and PrivateKey object, in addition to string).
Where do you set your callback url? There were some changes between OAuth 1.0
and
1.0a that are affected by the callback url. If you are setting it at the
beginning
of your code, try setting it right before calling createUserAuthorizationUrl().
One other thought, in your code snippet, what type does
RsaKeyUtil.getPrivateKey()
return (a byte array, a string, or a PrivateKey object)? Can you verify that
the key
is a Base-64 encoded private key string conforming to the PKCS #8 standard?
You can
find instructions here:
http://code.google.com/apis/gdata/oauth.html#keytool
Original comment by mon...@gmail.com
on 27 Aug 2009 at 7:36
Original issue reported on code.google.com by
denis.go...@gmail.com
on 20 Aug 2009 at 8:38