Hi guys,
I've been struggling with OmniAuth for Twitter for a past few days and
I can't get it to work with Rails 3.1
I'm not sure if this is a Twitter problem, or an OmniAuth problem.

I create the application on twitter, the steps vary a bit from the
Railscast showing it, but that's because of a Twitter UI change,
nothing big.
The thing is I get my app registered on Twitter, I get my
consumer_secret and my consumer_key, then I setup my omniauth
initializer with:

Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, '82I2sVYTqpxB9Pblahblahblah',
'VkiJYnbLSN4qs99diwsdjfasweirblahblahblah'
end

Then, I restart my server, browse /auth/twitter and I get an
OAuth::Unauthorized error. This is the server log:
Started GET "/auth/twitter" for 127.0.0.1 at 2011-09-22 20:30:33 -0300

OAuth::Unauthorized (401 Unauthorized):

Rendered /home/kandalf/.rvm/gems/ruby-1.9.3-preview1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/_trace.erb
(1.2ms)
Rendered /home/kandalf/.rvm/gems/ruby-1.9.3-preview1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb
(21.8ms)
Rendered /home/kandalf/.rvm/gems/ruby-1.9.3-preview1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb
within rescues/layout (25.3ms)

Any help would be very much appreciated.

Thanks a lot in advance.

--
Leonardo Mateo.
There's no place like ~

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Everaldo Gomes at Sep 22, 2011 at 11:57 pm
    Hi!

    Take a look in the omni populus gem:

    https://github.com/icelab/omnipopulus

    Best Regards,

    Everaldo
    On Thu, Sep 22, 2011 at 8:54 PM, Leonardo Mateo wrote:

    Hi guys,
    I've been struggling with OmniAuth for Twitter for a past few days and
    I can't get it to work with Rails 3.1
    I'm not sure if this is a Twitter problem, or an OmniAuth problem.

    I create the application on twitter, the steps vary a bit from the
    Railscast showing it, but that's because of a Twitter UI change,
    nothing big.
    The thing is I get my app registered on Twitter, I get my
    consumer_secret and my consumer_key, then I setup my omniauth
    initializer with:

    Rails.application.config.middleware.use OmniAuth::Builder do
    provider :twitter, '82I2sVYTqpxB9Pblahblahblah',
    'VkiJYnbLSN4qs99diwsdjfasweirblahblahblah'
    end

    Then, I restart my server, browse /auth/twitter and I get an
    OAuth::Unauthorized error. This is the server log:
    Started GET "/auth/twitter" for 127.0.0.1 at 2011-09-22 20:30:33 -0300

    OAuth::Unauthorized (401 Unauthorized):

    Rendered
    /home/kandalf/.rvm/gems/ruby-1.9.3-preview1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/_trace.erb
    (1.2ms)
    Rendered
    /home/kandalf/.rvm/gems/ruby-1.9.3-preview1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb
    (21.8ms)
    Rendered
    /home/kandalf/.rvm/gems/ruby-1.9.3-preview1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb
    within rescues/layout (25.3ms)

    Any help would be very much appreciated.

    Thanks a lot in advance.

    --
    Leonardo Mateo.
    There's no place like ~

    --
    You received this message because you are subscribed to the Google Groups
    "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to
    rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/rubyonrails-talk?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Leonardo Mateo at Sep 23, 2011 at 9:51 am

    On Thu, Sep 22, 2011 at 8:57 PM, Everaldo Gomes wrote:
    Hi!
    Take a look in the omni populus gem:
    https://github.com/icelab/omnipopulus
    Hey!
    I've just tried it and had the same result.
    I wonder if twitter might have changed something on their side for
    authenticating apps or if is omniauth on it's transition to 1.0.



    --
    Leonardo Mateo.
    There's no place like ~

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Martin Wawrusch at Sep 23, 2011 at 10:05 am
    I remember having had some trouble as well.

    Make sure that you use the following in your gem files:

    devise: ~=1.4.2
    ominauth: =0.2.5 (not 0.2.6 for some reason because that has a dependency
    conflict with another lib)

    In your production.rb do something like this at the top:

    require 'pg'
    require 'net/http'
    require 'openssl'
    OpenSSL::SSL:VERIFY_PEER = OpenSSL::SLL:VERIFY_NONE

    This is a bit of a hack but was the only way for me to get this to work in
    my configuration (after spending half a day investigating)
    On Fri, Sep 23, 2011 at 2:51 AM, Leonardo Mateo wrote:

    On Thu, Sep 22, 2011 at 8:57 PM, Everaldo Gomes
    wrote:
    Hi!
    Take a look in the omni populus gem:
    https://github.com/icelab/omnipopulus
    Hey!
    I've just tried it and had the same result.
    I wonder if twitter might have changed something on their side for
    authenticating apps or if is omniauth on it's transition to 1.0.



    --
    Leonardo Mateo.
    There's no place like ~

    --
    You received this message because you are subscribed to the Google Groups
    "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to
    rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/rubyonrails-talk?hl=en.

    -

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Leonardo Mateo at Sep 23, 2011 at 10:32 am

    On Fri, Sep 23, 2011 at 7:04 AM, Martin Wawrusch wrote:
    I remember having had some trouble as well.
    Make sure that you use the following in your gem files:
    devise: ~=1.4.2
    ominauth: =0.2.5 (not 0.2.6 for some reason because that has a dependency
    conflict with another lib)
    In your production.rb do something like this at the top:
    require 'pg'
    require 'net/http'
    require 'openssl'
    OpenSSL::SSL:VERIFY_PEER = OpenSSL::SLL:VERIFY_NONE
    This is a bit of a hack but was the only way for me to get this to work in
    my configuration (after spending half a day investigating)
    Hi Martin,
    That didn't work for me.
    Anywho, it seems to be a twitter issue, because I'm being able to
    authenticate with GitHub.
    It looks like a nice debugging case for OmniAuth, but I'm not sure if
    it worth it, since has been announced big architectural changes for
    version 1.0.
    Maybe this is fixed there, but I don't know how long version 1.0 will take.
    Does anyone knows about it?

    Thanks a lot in advance.

    --
    Leonardo Mateo.
    There's no place like ~

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedSep 22, '11 at 11:54p
activeSep 23, '11 at 10:32a
posts5
users3
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2022 Grokbase