# Adding SSO after many users already signed up -- how to migrate them?

**URL:** <https://meta.discourse.org/t/adding-sso-after-many-users-already-signed-up-how-to-migrate-them/232240>\
**Category:** SSO\
**Created:** [July 7, 2022, 7:53pm UTC](https://meta.discourse.org/t/adding-sso-after-many-users-already-signed-up-how-to-migrate-them/232240 "2022-07-07T19:53:40Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [July 7, 2022, 8:11pm UTC](https://meta.discourse.org/t/adding-sso-after-many-users-already-signed-up-how-to-migrate-them/232240/2 "2022-07-07T20:11:47Z")

</div>

Interesting approach.

In `user.rb`

```ruby
  def confirm_password?(password)
    return false unless password_hash && salt
    self.password_hash == hash_password(password, salt)
  end

  def hash_password(password, salt)
    raise StandardError.new("password is too long") if password.size > User.max_password_length
    Pbkdf2.hash_password(password, salt, Rails.configuration.pbkdf2_iterations, Rails.configuration.pbkdf2_algorithm)
  end

```

and then Pbkdf2 code is here: [discourse/lib/pbkdf2.rb at 201228162c277b9833bb2988388553fdbfb39521 · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/201228162c277b9833bb2988388553fdbfb39521/lib/pbkdf2.rb#L9)

---

_[View the full topic](https://meta.discourse.org/t/adding-sso-after-many-users-already-signed-up-how-to-migrate-them/232240)._
