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

  • SEARCH
  • Home
  • 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 8019399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:22:45+00:00 2026-06-04T21:22:45+00:00

I’m thinking of moving over to Omniauth 1.0 (using the identity strategy or gem)

  • 0

I’m thinking of moving over to Omniauth 1.0 (using the “identity” strategy or gem) from Devise 1.4.7, my question is after doing all the code conversion, views etc, will the old passwords, those user accounts created with Devise, still work with the same passwords under OmniAuth?

I’ve done some research and both are using bcrypt, so I’m guessing “yes” they will work as before and users won’t have to create new passwords. Or am I missing something crucial?

  • 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-04T21:22:47+00:00Added an answer on June 4, 2026 at 9:22 pm

    Devise passwords are not directly compatible with omniauth-identity

    It is true that they both use bcrypt to hash the password, however Devise adds a “pepper” to the password. You would have to add code to omniauth-identity to support a “pepper”.

    • OmniAuth-Identity – lib/omniauth/identity/secure_password.rb
    • Devise – lib/devise/models/database_authenticatable.rb

    Pepper your passwords

    Devise adds a pepper to your passwords (since it is already salted by bcrypt), so in order for you to migrate devise users to omniauth-identity, you have to teach the identity strategy how to pepper passwords. This snippit works for us, however we didn’t change the :stretches configuration option in devise.

    # snatch the pepper setting from the devise initializer
    pepper = "biglonguglystringfromyourdeviseinitializer"
    
    # password created by devise in your db (i.e. "my_password_123")
    encrypted_password = "$2a$10$iU.Br8ZClxuqldJt8Evl5OaBbHPJeBWbGV/1RoUsaNIZMBo8wHYTq" 
    
    # pepper the password then compare it using BCrypt like identity does
    BCrypt::Password.new(encrypted_password) == "my_password_123#{pepper}"
     => true
    

    How we made it work

    This is a very quick and dirty monkey patch we used to make it work. We are investigating how to add this functionality in a more appropriate manner.

    # file: ~/railsapp/config/initializers/omniauth.rb
    Rails.application.config.middleware.use OmniAuth::Builder do
      provider :identity
    end
    
    
    module OmniAuth
      module Identity
        module SecurePassword
          module InstanceMethodsOnActivation
            # Returns self if the password is correct, otherwise false.
            def authenticate(unencrypted_password)
              pepper = "the big pepper string from the devise initializer"
              if BCrypt::Password.new(password_digest) == "#{unencrypted_password}#{pepper}"
                self
              else
                false
              end
            end
    
            # Encrypts the password into the password_digest attribute.
            def password=(unencrypted_password)
              pepper = "the big pepper string from the devise initializer"
              @password = unencrypted_password
              unless unencrypted_password.empty?
                self.password_digest = BCrypt::Password.create("#{unencrypted_password}#{pepper}")
              end
            end
          end
        end
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a text area in my form which accepts all possible characters from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.