Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8941635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:21:08+00:00 2026-06-15T11:21:08+00:00

Trying to set up facebook authentication using devise, omniauth (including facebook-omniauth) on an app

  • 0

Trying to set up facebook authentication using devise, omniauth (including facebook-omniauth) on an app hosted on heroku.
Call to facebook API works, but I do not manage to skip the confirmation step after callback.

I followed the github tutorial on omniauth : https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview

and also read and tried to implement this :
Devise skip_confirmation! not working

But I keep getting the following error in my heroku log :

NoMethodError (undefined method `skip_confirmation!')

Here is how my devise.rb looks :

config.omniauth :facebook, "API_KEY", "API_SECRET"    

{:strategy_class => OmniAuth::Strategies::Facebook,
:scope => 'email, offline_access', :client_options => {:ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'}}}

Here is my omniauth_callbacks_controller.rb :

class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
  def facebook
   # You need to implement the method below in your model (e.g. app/models/user.rb)
   @user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user)

   if @user.persisted?
     sign_in_and_redirect @user, :event => :authentication #this will throw if @user is not activated
    set_flash_message(:notice, :success, :kind => "Facebook") if is_navigational_format?
   else
    session["devise.facebook_data"] = request.env["omniauth.auth"]
    redirect_to new_user_registration_url
   end
  end
end 

Here is my user.rb model :

def self.find_for_facebook_oauth(auth, signed_in_resource=nil)
 user = User.where(:provider => auth.provider, :uid => auth.uid).first
 unless user
       user = User.new(name:auth.extra.raw_info.name,
                    provider:auth.provider,
                    uid:auth.uid,
                    email:auth.info.email,
                    password:Devise.friendly_token[0,20],
                    )
       user.skip_confirmation!
       user.save
  end
  user
end

Thanks for your help !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:21:10+00:00Added an answer on June 15, 2026 at 11:21 am

    So if I’m right (not 100% secure), you need to declare that your model has the module confirmable, add the confirmable module:

       devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :omniauthable, :confirmable
    

    And make sure that you have the fields for the confirmable module on your users table, you should have the fields confirmation_token and confirmed_at

    If you don’t have those fields, check on this answer how to add them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the spring-security-facebook plugin for authentication. It works well, now I'm trying to
I'm trying to make a Facebook canvas app, eventually to be hosted on Heroku,
I am trying to set up a basic Facebook application using PHP and an
I'm trying to set a like for a page object on facebook using their
Im trying to create a facebook style newsfeed. Using jquery, I've managed to set
I am trying to set the fb app id (used by omniauth) so that
While trying to use Facebook's mobile authentication, I realized that they don't set any
I'm trying to set up the auth dialog of my facebook app to only
I'm trying to set opengraph properties for our site but facebook refuses to see
I'm trying to set up test users using the roles tab in the facebook

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.