users@jersey.java.net

Re: [Jersey] RSA-SHA1 signature with OAuth

From: Suneel Marthi <suneel_marthi_at_yahoo.com>
Date: Thu, 29 Oct 2009 09:19:51 -0700 (PDT)

Hubert,

I do realize that we could use the method you had suggested. But this is RSA-SHA1 (not HMAC-SHA1) signature method and there would be no need of ConsumerSecrets when using RSA.

But we would need to sign the Request using the RSA Private Key, how do I do that?
 
And yes I would like to use the OAuthClientFilter too .




________________________________
From: Hubert Le Van Gong <Hubert.Levangong_at_Sun.COM>
To: users_at_jersey.dev.java.net
Sent: Thu, October 29, 2009 12:04:35 PM
Subject: Re: [Jersey] RSA-SHA1 signature with OAuth

Hi,

It depends whether you're solely using the OAuth signature library or
if you also leverage the Jersey filters (Client in this case)?

If you just want to use the library then you need to use
the OAuthSignature class as follows:

OAuthSignature.sign(your_request, params, secrets);

HTH
Hubert




On Oct 29, 2009, at 4:34 PM, Suneel Marthi wrote:

How do I set the Private Key when making an OAuth Request using RSA-SHA1 signature method?
>
>This is what I currently have for HMAC-SHA1:-
>
> Client client = Client.create();
> OAuthSecrets secrets = new OAuthSecrets().consumerSecret("test_test");
>
> OAuthParameters params = new OAuthParameters().consumerKey("test").signatureMethod(HMAC_SHA1.NAME);
>
> OAuthClientFilter filter = new OAuthClientFilter(client.getProviders(), params, secrets);
>
>
>For RSA-SHA1, I do not need the OAuthSecrets, so this is what I would have:-
>
> Client client = Client.create();
>
> OAuthParameters params = new OAuthParameters().consumerKey("test").signatureMethod(RSA_SHA1.NAME);
>
>Next I would need to sign the request using my private Key, how do I do that?
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>

--
Hubert A. Le Van Gong
Identity Architect
Sun microsystems, Inc.
17 Rue Duprey
Grenoble, 38000
France
--------------------------------------------------
email: hubert.levangong_at_sun.COM
tel:+33 4 7663 0935
blog: http://blog.levangong.com/
N 45  11.900'
W 005  44.145'Elev. 736 ft.