On Apr 28, 12:12 pm, "Pelle Braendgaard" <pel
...@gmail.com> wrote:
> We have RSA support in the OAuth gem but it seems pretty incomplete.
> Has anyone been using it?
I tried :-)
> As Google are using RSA as their only supported signature method at
> the moment, it would probably be a good idea to verify that this
> actually works and maybe improve the flow.
With some hacking, I got it 0.2.5 working against the Google OAuth
for their Contacts Data API[1]. First off, as pointed out here[2], the
oauth_signature_method hash doesn't appear to work. (I just
switched the hardcoded references to hmac-sha1 to be rsa-sha1)
Also, as documented here[3], OAuth::Signature::RSA::SHA1
is trying to use request.consumer.secret instead of plain old
consumer_secret. (The post above talks about the == op, but
the digest method has the same issue)
Finally, for those following along at home, in [1] the scope is
given using an http rather than an https scheme URL. This
results in a 401 "Unknown authorization header" or a
"401 Token invalid - AuthSub token has wrong scope" Both
the scope in the GetRequestToken call and the access_token
get url must be https (and the scope param needs to be
encoded)
But in the end, it did work, and I successfully retrieved a
contact list. Thanks for all the work!
-cks
[1] http://groups.google.com/group/oauth/browse_thread/thread/75ee6d97393...
[2]
http://groups.google.com/group/oauth-ruby/browse_thread/thread/64f099...
[3] http://groups.google.com/group/oauth-ruby/browse_thread/thread/b19e74...