omniauth

OmniAuth Invalid Response Error

倖福魔咒の 提交于 2019-12-02 02:53:57
问题 I'm using OmniAuth with Devise to allow users to login with facebook or to create a normal account with a username and password. When I originally set it all up I used the excellent directions from Railscasts. Everything was working very nicely for 2+ months but just the other day the facebook login stopped working. OmniAuth sends you away to the authentication with facebook and then returns with: http://localhost:3000/auth/failure?message=invalid_response Google has no suggestions on what

I am using rails cast omniauth and i get this error

大憨熊 提交于 2019-12-02 01:10:43
I am using Mongodb as database in rails and i got error when using /auth/linkedin/callback NoMethodError in AuthenticationsController#create undefined method []' for nil:NilClass Rails.root: /home/prem/Music/heronhrm Application Trace | Framework Trace | Full Trace app/models/user.rb:57:in apply_omniauth' app/controllers/authentications_controller.rb:19:in `create' Also when i remove self.email = omniauth['user_info']['email'] if email.blank? from usermodel then the validation errors arises in users/sign_up Email can't be blank I want to implement for twitter,linkdin and facebook. my

OmniAuth Invalid Response Error

时光总嘲笑我的痴心妄想 提交于 2019-12-02 00:59:58
I'm using OmniAuth with Devise to allow users to login with facebook or to create a normal account with a username and password. When I originally set it all up I used the excellent directions from Railscasts . Everything was working very nicely for 2+ months but just the other day the facebook login stopped working. OmniAuth sends you away to the authentication with facebook and then returns with: http://localhost:3000/auth/failure?message=invalid_response Google has no suggestions on what causes this error or how to fix it and the OmniAuth docs don't either. I've tried digging through their

recursively convert hash containing non-UTF chars to UTF

本秂侑毒 提交于 2019-12-01 21:39:24
问题 I have a rogue gem (omniauth) which provides a hash of data containing ASCII-BIT8 strings that I would like to convert into UTF. How can I force all of the string elements of the hash into UTF, as some kind of rails initializer method? .to_utf8 initilizer session[:omniauth] = omniauth.to_utf8 class Hash def to_utf8 #not really sure what to do here? end end 回答1: In Ruby 1.9 you can usually just flip the encoding using the encode method. A wrapper around this that recursively transforms the

Omniauth Facebook redirects to registration screen instead of creating user

落爺英雄遲暮 提交于 2019-12-01 21:01:42
Following the gem's tutorial exactly I still seem to be running into some issues. I first click the link to sign up via Facebook and get redirected to Facebook. I click okay and get brought back to my registration page. No new user is created. If I try to click the register link again it just refreshes the page with this in the address bar http://localhost:3000/register#_=_ . What am I doing wrong? User Model devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :omniauthable, omniauth_providers: [:facebook] def self.from_omniauth(auth) where

Passing random url params to OmniAuth

穿精又带淫゛_ 提交于 2019-12-01 18:11:49
I'm using omniauth with devise and I'm wondering how to pass url params and access them. Here's a link example: /accounts/auth/facebook?do_something_after_return=1 Now I want to be able to retrieve this do_something_after_return in the callback. I don't care if it's saved in session or elsewhere. Problem is, I don't know where can I intercept this param. What is the controller and the action that link /accounts/auth/facebook points to? Routes tell me nothing, it's simply not there. All I have in the routes is this /accounts/auth/:provider(.:format {:controller=>"accounts/omniauth_callbacks",

Passing random url params to OmniAuth

只谈情不闲聊 提交于 2019-12-01 16:20:34
问题 I'm using omniauth with devise and I'm wondering how to pass url params and access them. Here's a link example: /accounts/auth/facebook?do_something_after_return=1 Now I want to be able to retrieve this do_something_after_return in the callback. I don't care if it's saved in session or elsewhere. Problem is, I don't know where can I intercept this param. What is the controller and the action that link /accounts/auth/facebook points to? Routes tell me nothing, it's simply not there. All I have

Rails, Devise & Omniauth - problems with setup

℡╲_俬逩灬. 提交于 2019-12-01 16:16:56
I am trying (again) to set up authentications with Rails 4, devise and omniauth. I tried to follow the example in this post: Rails 4, Devise, Omniauth (with multiple providers) I have these gems installed: gem 'devise' gem 'omniauth-google-oauth2' gem 'omniauth-facebook' gem 'omniauth-twitter' gem 'omniauth-linkedin-oauth2' gem 'oauth2' I have a user model, and an authentications model. I have: User.rb: has_many :authentications def disapprove self.approved = false end def approve self.approved = true end SOCIALS = { facebook: 'Facebook', google_oauth2: 'Google', linkedin: 'Linkedin' } def

DangerousAttributeError in OmniAuth Railscast Tutorial: create is defined by ActiveRecord

只愿长相守 提交于 2019-12-01 16:09:27
I've looked at ActiveRecord::DangerousAttributeError and other similar threads on SO, but they don't address the same issue. I'm following the omniauth tutorial: http://railscasts.com/episodes/235-omniauth-part-1?view=asciicast I'm able to authenticate via oauth with Twitter and return the user's data (auth). The problem is that I'm not able to create/save it in the database (sqlite3) because of this error message. Error: ActiveRecord::DangerousAttributeError in AuthenticationsController#create create is defined by ActiveRecord Rails.root: /beta/devise-omniauth1 Application Trace | Framework

DangerousAttributeError in OmniAuth Railscast Tutorial: create is defined by ActiveRecord

安稳与你 提交于 2019-12-01 15:57:27
问题 I've looked at ActiveRecord::DangerousAttributeError and other similar threads on SO, but they don't address the same issue. I'm following the omniauth tutorial: http://railscasts.com/episodes/235-omniauth-part-1?view=asciicast I'm able to authenticate via oauth with Twitter and return the user's data (auth). The problem is that I'm not able to create/save it in the database (sqlite3) because of this error message. Error: ActiveRecord::DangerousAttributeError in AuthenticationsController