omniauth

Rails + omniauth + facebook - csrf detected

浪子不回头ぞ 提交于 2020-01-11 03:16:06
问题 I'm working on logging in a site via existing facebook account. So I registered a facebook application and stored api and secret in development.rb and production.rb files. Then I used omniauth-facebook gem + devise gem to implement this. It works perfect. By the way, an user can login either by internal authentication (by devise) or by usig facebook account. However there is a weird issue. It works perfect only if I login into facebook account in that I registered an application. So I

Rails: Could not authenticate you from Facebook because “Invalid credentials”

一世执手 提交于 2020-01-10 18:45:20
问题 I integrated omniauth-facebook using https://github.com/plataformatec/devise/wiki/OmniAuth%3a-Overview. But I am getting error of : Could not authenticate you from Facebook because "Invalid credentials". And in logs, getting this: Authentication failure! invalid_credentials: OAuth2::Error, : {"error":{"message":"This authorization code has been used.","type":"OAuthException","code":100}} I have devise installed. When i click on facebook sign in link, it comes back to devise sign "www.mealnut

WEBrick: RequestURITooLarge: should I update or use a different server?

风流意气都作罢 提交于 2020-01-09 11:11:46
问题 I currently have: $ rails s => Booting WEBrick => Rails 3.0.9 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2011-11-30 13:18:00] INFO WEBrick 1.3.1 [2011-11-30 13:18:00] INFO ruby 1.9.2 (2011-02-18) [x86_64-darwin10.8.0] [2011-11-30 13:18:00] INFO WEBrick::HTTPServer#start: pid=4204 port=3000 The problem I'm having is I'm using openID for auth and getting the following error: [2011-11-30 13:18:19] ERROR WEBrick::HTTPStatus:

How to get timezone from facebook with omniauth?

给你一囗甜甜゛ 提交于 2020-01-07 00:40:11
问题 Everything in user.rb is passing correctly upon sign up except timezone. I can't figure out why I'm getting this error upon a user attempting to sign in: 2016-03-30T20:13:38.083469+00:00 app[web.1]: NoMethodError (undefined method `timezone=' for #<User:0x007fdd2976e338>): 2016-03-30T20:13:38.083470+00:00 app[web.1]: app/models/user.rb:72:in `block in from_omniauth' 2016-03-30T20:13:38.083471+00:00 app[web.1]: app/models/user.rb:66:in `tap' 2016-03-30T20:13:38.083471+00:00 app[web.1]: app

How do I update & display a current user's tags, tagged with acts_as_taggable_on?

巧了我就是萌 提交于 2020-01-06 17:15:30
问题 I'm not sure how to display tags in my view that belong to a user logged in with Omniauth. A page in the view loads a random photos and tags associated to it (via a form that can be updated from that page). It works, but when I log in with Facebook account A, it will show exactly the same tags as if I log in with Facebook account B. Getting the whiny nil error with this below Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id The view is: <%=

How do I update & display a current user's tags, tagged with acts_as_taggable_on?

元气小坏坏 提交于 2020-01-06 17:15:14
问题 I'm not sure how to display tags in my view that belong to a user logged in with Omniauth. A page in the view loads a random photos and tags associated to it (via a form that can be updated from that page). It works, but when I log in with Facebook account A, it will show exactly the same tags as if I log in with Facebook account B. Getting the whiny nil error with this below Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id The view is: <%=

devise : new user registration issues , PG::ProtocolViolation . Rails4, Postgres

Deadly 提交于 2020-01-06 15:13:39
问题 I am using devise and omni-auth to login with linkedin . I added the from_omniauth method to user model as mentioned in the Railscast: This is the code: #Create a new user if does not exist def self.from_omniauth(auth) where(auth.slice(:provider, :uid)).first_or_create! do |user| user.provider = auth.provider user.uid = auth.uid user.email = auth.info.email end end Started GET "/users/auth/linkedin/callback?oauth_token=XXX" INFO -- omniauth: (linkedin) Callback phase initiated. Processing by

Saving the Comment object after successfull oauth login with Rails' omniauth

╄→尐↘猪︶ㄣ 提交于 2020-01-06 05:38:06
问题 I want rails to either update or store the Comment after a user did a successfull loging trough omniauth (Twitter, Facebook or OpenID). A (not logged in) user fills in a comment form. Posts that. User gets an omniauth page where she can choose the sign-in-method: Twitter, Facebook or OpenID. Once the user returns from the oAuth successfully, I want to store (or publish) the Comment. I have this working, using a session-variable, but that is not very thread-safe: it will break if a user has

Twitter::Error::Forbidden - Unable to verify your credentials

梦想与她 提交于 2020-01-06 04:35:11
问题 I'm using devise + omniauth and I can connect to twitter api correctly. But when I try to use twitter gem, I have the following error in console : "Twitter::Error::Forbidden - Unable to verify your credentials" I have installed the gem and created an initializer at config/initializers/twitter.rb Twitter.configure do |config| config.consumer_key = PKe41... config.consumer_secret = qETY..... end And I'm trying into a controller : def twitter @twitter_home_timeline = Twitter.home_timeline end

Understanding how to use omniauth-github gem in conjunction with the Github API

匆匆过客 提交于 2020-01-05 08:56:05
问题 I've decided to use the omniauth-github gem in conjunction with the github_api gem. However, I'm not 100% sure how to use the authorization I've received back from github to use the github_api gem. I know Github.new basic_auth: 'user:password' and Github.new oauth_token 'token' but I'm not exactly sure how to get that token as a response. Any help would be appreciated! Thank you fellow rubyists. 回答1: If you add the following line of code at the beginning of your authentications/sessions