Hi Nikhil,
    I was getting the following NoMethodError (the very same error you
were getting) when trying to do OAuth::Signature.verify(request) in my
rails application....
undefined method `consumer' for
#<OAuth::RequestProxy::ActionControllerRequest:0x4590b24>

I saw your post reporting that it is a bug in sha1.rb for it to be
using request.consumer.secret, and that consumer_secret is the right
usage. I applied the following patch (posted by you) to my sha1.rb
-      public_key = OpenSSL::PKey::RSA.new(request.consumer.secret)
+      public_key = OpenSSL::PKey::RSA.new(consumer_secret)

But, after the change, i see 'customer_secret' is nil when making the
call OpenSSL::PKey::RSA.new(customer_secret) in sha1.rb
Just curious, may i know where customer_secret is defined?

-Vikram

On Mar 13, 11:52 am, Nikhil Gupte <[EMAIL PROTECTED]> wrote:
> Thanks Arne,
>
> I finally seem to have got it working. There were some bugs inoauth-ruby. 
> I've submitted patches for the same.
> Anyone interested please refer 
> tohttp://groups.google.com/group/oauth-ruby/browse_thread/thread/ac0f71...
>
> On Mar 13, 1:54 am, "Arne Roomann-Kurrik" <[EMAIL PROTECTED]>
> wrote:
>
> > That looks like progress.  What does your verification step look like?
>
> > ~Arne
>
> > On Wed, Mar 12, 2008 at 12:27 PM, Nikhil Gupte <[EMAIL PROTECTED]>
> > wrote:
>
> > > Thanks Arne.
>
> > > Now I'm getting the request as invalid.
> > > This is what I'm doing:
> > > 1. cert = OpenSSL::X509::Certificate.new(PATH/TO/CERT_FILE) # Get
> > > certificate...
> > > 2. public_key = cert.public_key # Get the public key...
> > > 3. # verify...
>
> > > I've even tried replacing Step #2 with:
> > > 2. publick_key = OpenSSL::PKey::RSA.new(cert.public_key)
>
> > > I don't understand this stuff too well and hence hope you can spot
> > > what I'm doing wrong. In the mean time, I'm reading-up onoauth...
>
> > > Thanks!
>
> > > On Mar 12, 10:02 pm, "Arne Roomann-Kurrik" <[EMAIL PROTECTED]>
> > > wrote:
> > > > Hi Nikhil,
>
> > > >    Sorry, I don't do very much withRuby, but it appears that you're
> > > > treating the certificate file like a public key.  This is incorrect -
> > > the
> > > > certificate encodes the public key and some other information in a
> > > > X.509certificate format.  You can paste the contents of the file
> > > > you're loading
> > > > here:http://www.redkestrel.co.uk/utilities/CertDecoder.htmltoseewhat
> > > > information is contained.
>
> > > >Rubyshould have some libraries to decode X.509 certificates for you.  A
> > > > quick google search indicates that OpenSSL::X509::Certificate may be
> > > able to
> > > > help you access this information:
> > >http://raa.ruby-lang.org/project/openssl/
> > > > You should be able to decode the certificate, obtain the public key, and
> > > > then pass that to the RSA.new constructor.
>
> > > > ~Arne
>
> > > > On Wed, Mar 12, 2008 at 4:52 AM, Nikhil Gupte <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > > Hi,
>
> > > > > I'm using theoauth-rubyAPI. It seems to think that the certificate @
> > > > >http://sandbox.orkut.com/46/o/pub.1199819524.-1556113204990931254.cer
> > > > > is invalid. It says that it's neither a public nor private key file
>
> > > > > Following is a quick way (bypassing everything else to simplify) to
> > > > > demonstrate the issue:
> > > > > $ irb
> > > > > > require 'openssl'
> > > > > > OpenSSL::PKey::RSA.new(File.read("/PATH/TO/pub.1199819524.-
> > > > > 1556113204990931254.cer"))
>
> > > > > OpenSSL::PKey::RSAError: Neither PUB key nor PRIV key:: nested asn1
> > > > > error
>
> > > > > Can anyone please let me know what I'm doing wrong?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Orkut Developer Forum" group.
To post to this group, send email to opensocial-orkut@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to