omniauth

Latest omniauth-facebook gem breaks devise

拟墨画扇 提交于 2021-02-20 09:45:48
问题 ruby '2.6.3' gem 'rails', '~> 6.0.2', '>= 6.0.2.1' I'm using the latest omniauth-facebook and devise together Gemfile: gem 'devise' gem 'omniauth-facebook' Getting this error when starting the server: /versions/2.6.3/lib/ruby/gems/2.6.0/gems/devise-4.7.3/lib/devise/omniauth.rb:12:in `': You are using an old OmniAuth version, please ensure you have 1.0.0.pr2 version or later installed. (RuntimeError) The problem is that if I try to use older omniauth-facebook versions the server works but then

Latest omniauth-facebook gem breaks devise

对着背影说爱祢 提交于 2021-02-20 09:41:56
问题 ruby '2.6.3' gem 'rails', '~> 6.0.2', '>= 6.0.2.1' I'm using the latest omniauth-facebook and devise together Gemfile: gem 'devise' gem 'omniauth-facebook' Getting this error when starting the server: /versions/2.6.3/lib/ruby/gems/2.6.0/gems/devise-4.7.3/lib/devise/omniauth.rb:12:in `': You are using an old OmniAuth version, please ensure you have 1.0.0.pr2 version or later installed. (RuntimeError) The problem is that if I try to use older omniauth-facebook versions the server works but then

sign_in_and_redirect with omniauth-facebook to specific language

倾然丶 夕夏残阳落幕 提交于 2021-01-29 05:43:01
问题 I'm using omniauth-facebook gem with rails 3.2 and devise 2.0. I have a website with 2 languages, english and spanish. http://localhost:3000/en http://localhost:3000/es The gem works fine for english users because in omniauth_callbacks_controller.rb the redirect go to http://localhost:3000/en This is my omniauth_callbacks_controller.rb for facebook: def facebook @user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user) if @user.persisted? flash[:notice] = I18n.t "devise

How to do omniauth on wildcard subdomain

泄露秘密 提交于 2021-01-27 23:07:07
问题 I'm have omniauth working in my Rails app on the top level domain. Now I want to do it on any given subdomain (users each get their own subdomain assigned dynamically). I can't find a way to dynamically change the callback url on the fly with omniauth Leaving it as is, in the callback I can see the referrer and know which subdomain they came from, and log them in, but when I then redirect them to their subdomain they are logged out because the session was on the top level domain. I'm using

How to do omniauth on wildcard subdomain

倾然丶 夕夏残阳落幕 提交于 2021-01-27 21:48:33
问题 I'm have omniauth working in my Rails app on the top level domain. Now I want to do it on any given subdomain (users each get their own subdomain assigned dynamically). I can't find a way to dynamically change the callback url on the fly with omniauth Leaving it as is, in the callback I can see the referrer and know which subdomain they came from, and log them in, but when I then redirect them to their subdomain they are logged out because the session was on the top level domain. I'm using

Switch provider for the omniauth-shopify-oauth2 gem in runtime?

痴心易碎 提交于 2020-03-23 08:12:18
问题 The initializer for the omniauth-shopify-oauth2 gem is supposed to look like this: # config/initializers/omniauth.rb Rails.application.config.middleware.use OmniAuth::Builder do provider :shopify, ENV['SHOPIFY_API_KEY'], ENV['SHOPIFY_SHARED_SECRET'] end However, in our Rails app resides a few different brands who offers the same functionality. Throughout the entire app, the request.domain of a request determines which brand you are exposed to ( brand1.example.com , brand2.example.com , etc.).

Is it possible to use Omniauth with Devise-JWT?

倾然丶 夕夏残阳落幕 提交于 2020-03-23 08:04:11
问题 I have Devise and Devise-JWT configured and working for a React single page application using good old email and password. Now, I'd like my users to be able to log in using Facebook/Google/Twitter, etc. Is Omniauth the way to go? I have Omniauth sort of working with the Developer strategy and I wrote a method that generates the bearer token (I think): class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController def developer @user = User.from_omniauth(request.env["omniauth

What's the correct configuration line to get devise, omniauth and google working?

爱⌒轻易说出口 提交于 2020-02-03 23:41:53
问题 I've looked through the documentation and I can't figure out the specific line I'm meant to use to get devise + omniauth + google working together nicely. This strategy file suggests there's an easy way of doing it but I can't find an example. https://github.com/intridea/omniauth/blob/master/oa-oauth/lib/omniauth/strategies/google.rb At the moment I'm using the line below in the devise.rb initializer file. config.omniauth :google, GOOGLE_APP_ID, GOOGLE_SECRET_KEY but I'm pretty sure it's

undefined method 'change' for :Fixnum when updating Timestamp value

核能气质少年 提交于 2020-01-15 08:58:33
问题 I'm using Google's OAuth2 API in a project, using Omniauth to enable creating the initial accounts with little effort, but in order to use the APIs I need to refresh the access_token since they're only valid for an hour, but I'm having an issue updating the expires_at value when I refresh the token. Here's the code I'm using for requesting the token refresh: require 'oauth2' class Identity < ActiveRecord::Base belongs_to :user def refresh_access_token case self.provider when "google" client =

How to Use OmniAuth Properly with Rails 2

Deadly 提交于 2020-01-15 06:24:30
问题 I am trying to use an OmniAuth (0.2.6) strategy for my application. The architecture is Rails 2.3.10 and Rack is version is 1.1 (this version or higher is required for OmniAuth). A problem that occurs is Rails doesn't recognize my redirect to "/auth/provider". The actual error message is "No route matches "/auth/casport". Even though that error gets thrown, the code seems to execute past that point up to this error: "request.env['omniauth.auth']", which I'm pretty sure means it doesn't