omniauth

Why am I receiving “This authorization code has been used” after the first 2 users?

故事扮演 提交于 2019-12-11 11:53:47
问题 I'm using Omniauth-Facebook to create and authenticate User. It works for the two first users, but fails for the third one. I still can authenticate; it's the CREATE process which fails. This appears to be a common issue without a solution. error.log: facebook) Callback phase initiated. (facebook) Authentication failure! invalid_credentials: OAuth2::Error, : {"error":{"message":"This authorization code has been used.","type":"OAuthException","code":100}} onmiauth.rb: Rails.application.config

NoMethodError in Devise::RegistrationsController#create /undefined method `encrypted_password=' for #<User:0x459b2b0>

依然范特西╮ 提交于 2019-12-11 10:09:33
问题 I am using omniauth and devise for login/sessions/signup facebook login... I get the error anytime I try to sign up, login, or etc. I guess some other things don t work in my sessions and callbacks. I tried adding encrypted_password in the migrations but still not working. Here is the migration: class AddColumnsToUsers < ActiveRecord::Migration def change add_column :users, :provider, :string add_column :users, :uid, :string add_column :users, :encrypted_password, :string end end Here is my

Rails Omniauth Facebook login redirects to sign up

余生长醉 提交于 2019-12-11 08:38:02
问题 for some reason my Omniauth Facebook login is redirecting to /users/sign_up# = - but otherwise appears to be working. I have this in routes.rb: devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } I have this in application.html.erb: <%= link_to "", user_omniauth_authorize_path(:facebook, :origin=>"root_url") %> <%= link_to(image_tag("FB-Login.png"), user_omniauth_authorize_path(:facebook), :origin=>"root_url", class:"mycss") %> I have this in application

User.find_for_oauth - where can I find it?

☆樱花仙子☆ 提交于 2019-12-11 08:09:18
问题 I'm studying Devise + omniauth. In most examples I find method User.find_for_oauth Where can I find docs for this method & its ins and outs? Is it provided by Devise or omniauth gems? here and here are some examples where I came across it. 回答1: The User.find_for_oauth() isn't provided by Devise or Omniauth. It's something you have to provide. Have another look at the examples in the links you gave. They show code for find_for_auth. The first link has it in the app/models/user.rb code in the

HowTo Write tests for Devise & Omniauth in my Rails 3 app?

拟墨画扇 提交于 2019-12-11 05:16:09
问题 I have a Rails 3 app with Omniauth and Devise. I haven't been able to find a solid tutorial showing how I should write specs for testing the functionality. What I want to achieve is to ensure that the Sign Up and Sign In forms are working... meaning users can create accounts. I also want to be sure that the Omniauth FB Connect works as well at all times. What/how can I write test for these scenarios above? Thanks 回答1: The tests were very useful to test the pretty complex method I have to

Linkedin oauth2 r_liteprofile not being returned from api

陌路散爱 提交于 2019-12-11 04:45:34
问题 So I have a rails app and I am using this gem for oauth2. Now on the developer's console on linkedin I can only select r_basicprofile , r_emailaddress , rw_company_admin and w_share . So I have r_basicprofile selected. Now once identified linkedin in pushing the user to http://localhost:3000/auth/linkedin/callback?error=unauthorized_scope_error&error_description=Scope+%26quot%3Br_liteprofile%26quot%3B+is+not+authorized+for+your+application&state

Devise 1.5 + Omniauth 1.0 + Facebook: undefined method `extra`

家住魔仙堡 提交于 2019-12-11 03:17:56
问题 I'm trying to get my Cucumber test to work with Devise 1.5 and Omniauth 1.0, with Facebook authentication. Funny thing is, it works on development mode, but when run the Cukes test, it fails with this message: undefined method `extra' for #<Hash:0x007f95f0d26260> (NoMethodError) ./app/models/user.rb:13:in `find_for_facebook_oauth' ./app/controllers/users/omniauth_callbacks_controller.rb:4:in `facebook' (eval):2:in `click_link' ./features/step_definitions/web_steps.rb:58:in `/^(?:|I )follow "(

How to test SessionsController for OmniAuth with Minitest

☆樱花仙子☆ 提交于 2019-12-11 02:44:09
问题 I'm trying to test my facebook login code with Minitest, but it's not going well. When I try get :auth, 'provider' => 'facebook' in test, test returns undefined method '[]' for nil:NilClass , and if I try get :new it passes, but auth is not called. How can I successfully get redirected to auth with omniauth? Here's my source code. test/controllers/sessions_controller_test.rb require 'test_helper' class SessionsControllerTest < ActionController::TestCase test '#signup_success' do OmniAuth

OmniAuth dynamic client options site within the strategy

依然范特西╮ 提交于 2019-12-11 02:04:16
问题 I have a rails app set up as an OAuth2 provider (using Doorkeeper). The app uses a different subdomain per user account (or an entirely different domain through a cname record) i.e. user1.myrailsapp.com user2.myrailsapp.com www.mycustomdomain.com On the provider side, everything is working as expected. I also have a second app that is a client making use of the first app's exposed API. I have a version of the client working but only with a hard coded site url in the OmniAuth strategy. The

Facebook login with OmniAuth Error Change was Rejected

£可爱£侵袭症+ 提交于 2019-12-11 01:36:18
问题 I was able to set up my Facebook and Twitter Login using Omniauth http://railscasts.com/episodes/241-simple-omniauth my Rails app. My login works perfectly on my computer (I tested both on production and development) and I did not detect a problem until someone e-mailed me this problem when he tried to sign in with Facebook: The change you wanted was rejected. Maybe you tried to change something you didn't have access to. It turns out that no one else can sign in or create an account through