# 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:** 6

<div class="post-metadata">

**Author:** ![EGreg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/egreg/32/133614_2.png) [@EGreg](https://meta.discourse.org/u/EGreg)\
**Post date:** [July 8, 2022, 2:33am UTC](https://meta.discourse.org/t/adding-sso-after-many-users-already-signed-up-how-to-migrate-them/232240/6 "2022-07-08T02:33:42Z")

</div>

I just spoke to our team, and they agree, I’m prepared to pay someone to build a small Discourse plugin that would expose via an endpoint some JSON info about a user, given their email address.

I found [discourse/app/models/user.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/app/models/user.rb#L1855) has “password\_hash” salt and name, username. But it doesn’t have email. For that, I see user\_email [discourse/app/models/user\_email.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/app/models/user_email.rb)

So given an email the plugin will just search user\_email table by the mail, then find user\_id and grab the user row, and send all the “safe” fields, including the salt.

For extra security, the requests can be signed via HMAC using a shared secret that can be provided to the plugin.

Does anyone want to make this one? Message me or reply here and let me know how to contact you. Hopefully it’s straightforward (a couple SELECTs and a check for HMAC if the secret was set). We’ll read the JSON.

---

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