FAQ Database Discussion Community


OAuth::Unauthorized 400 error with Google+ login API

ruby-on-rails,login,devise,google-api,omniauth
I'm trying to set up Google+ login with Devise and omniauth in an app I'm working on and running into an OAuth::Unauthorized 400 error. I'm using the omniauth-google gem. My Devise config sets up omniauth for Google: config.omniauth :google, ENV['GOOGLE_KEY'], ENV['GOOGLE_SECRET'], scope: 'plus.login' I'm running the site locally on dev.app.com:3000,...

Error with `check_validity!'

ruby-on-rails,facebook,devise,omniauth
I'm getting this error when trying to migrate. I've looked into my user.rb but I don't see how validate_format_of is causing an error. Below is my user.rb and error log: ArgumentError: Either :with or :without must be supplied (but not both) /Users/admin/.rvm/gems/ruby-2.2.0/gems/activemodel-4.1.6/lib/active_model/validations/format.rb:17:in `check_validity!' /Users/admin/.rvm/gems/ruby-2.2.0/gems/activemodel-4.1.6/lib/active_model/validator.rb:157:in `initialize'...

Omniauth Facebook Devise fails production Heroku but works in development

ruby-on-rails,heroku,devise,omniauth,omniauth-facebook
I developed this app on Nitrous.io (using a heroku postgresql DB). Omniauth works correctly when tested on that platform. When I try on production Heroku, I get a "The parameter app_id is required" error from facebook. inside devise.rb config.omniauth :facebook, ENV["FB_APP_ID"], ENV["FB_APP_SECRET"] My facebook developer site url's and callbacks are...

Google authentification with “devise” fail

ruby-on-rails,devise,google-oauth,omniauth
I want to create a GOOGLE authentification in my app. So in set up "omniauth" and "devise" correctly (I think). In my layout folder in "_header.html.erb" view : <% if user_signed_in? %>Signed in as <%= current_user.name %>. Not you? <%= link_to "Sign out", destroy_user_session_path,:method => :delete %> <% else %>...

When connecting to Linkedin with OAuth, is it possible to get the user's non-primary email addresses?

ruby-on-rails,oauth,devise,linkedin,omniauth
I'm using Devise and the omniauth-linkedin gem to allow users to log into my Rails app with a LinkedIn account (Rails 4.1.8, Devise 3.4.0, omniauth-linkedin 0.2.0). I've had no trouble getting the user's primary email from LinkedIn, but I'm wondering, is it possible to get a list of ALL the...

Facebook authentication is raising an error on rails 3.2.3

ruby-on-rails,facebook,authentication,devise,omniauth
I setup a rails app (3.2.3 [devise 3.4.1, omniauth facebook 2.0.0, omniauth 1.2.2]) to use facebook as authenticator and I'm facing this issue when I try to log in. The problem is, it doesn't even reach my code (controllers). Do you have any idea about this? It's strange that when...

JSON parameters not available in request hash (Rails, omniauth-google-oauth2 gem)

ruby-on-rails,json,omniauth,rack
Overview I want to implement the Google OAuth2 server side (hybrid) with the Omniauth Google OAuth2 Gem (0.2.6). However, the code parameter I send to my app does not get added to the request.params hash. Thus, OmniAuth throws an error, as it can't find the code. Details After retrieving the...

GitLab LDAP scondary strategy

ruby-on-rails,ldap,omniauth,gitlab
I'm using GitLab CE Omnibus package (gitlab_7.7.2-omnibus.5.4.2.ci-1_amd64) on a clean Debian (debian-7.8.0-amd64) installation. I followed the installation process on https://about.gitlab.com/downloads/ and everything works fine. I modified /etc/gitlab/gitlab.rb to use a single LDAP server for authentification. Which worked also as expected. But when I tried to use a secondary LDAP connection...

current_user nil after successful sign_in while using mongoid and devise

ruby-on-rails,ruby,authentication,devise,omniauth
for context, i'm using devise 3.4.1, mongoid 4.0.0, rails 4.1.7 when i sign in (successfully), i am redirected to the root path as dictated by my after_sign_in_path_for. from here, i assume my user is signed in. however, once i navigate to another page that references current_user in a controller method,...

Give points to user just on first signup with Facebook in Rails 4

ruby-on-rails,ruby-on-rails-4,model-view-controller,devise,omniauth
I use Facebook-omniauth gem with devise to register users Here is what i have in my callback class CallbacksController < Devise::OmniauthCallbacksController def facebook @user = User.from_omniauth(request.env["omniauth.auth"]) if @user.persisted? flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook" sign_in_and_redirect @user else session["devise.facebook_data"] = request.env["omniauth.auth"] redirect_to new_user_registration_url end end end I want to add...