# Programmatically adding users when SSO is being used

**URL:** https://meta.discourse.org/t/programmatically-adding-users-when-sso-is-being-used/79925
**Category:** SSO
**Created:** [February 6, 2018, 4:33pm UTC](https://meta.discourse.org/t/programmatically-adding-users-when-sso-is-being-used/79925 "2018-02-06T16:33:55Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [February 6, 2018, 5:04pm UTC](https://meta.discourse.org/t/programmatically-adding-users-when-sso-is-being-used/79925/5 "2018-02-06T17:04:53Z")

</div>

You can create users with the `sync_sso` route. There is some PHP code in this post that gives an example of how to do it: [If someone changes their email in WordPress, change it in Discourse - sso\_sync - #3 by simon](https://meta.discourse.org/t/if-someone-changes-their-email-in-wordpress-change-it-in-discourse-sso-sync/76572/3). In that code, it’s being used to update a user’s email, but the same idea will work to create a new user.

---

_[View the full topic](https://meta.discourse.org/t/programmatically-adding-users-when-sso-is-being-used/79925)._
