# Allow user creation via API when enable\_local\_logins is disabled

**URL:** https://meta.discourse.org/t/allow-user-creation-via-api-when-enable-local-logins-is-disabled/110431
**Category:** Feature
**Created:** [March 1, 2019, 10:59am UTC](https://meta.discourse.org/t/allow-user-creation-via-api-when-enable-local-logins-is-disabled/110431 "2019-03-01T10:59:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ryancey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryancey/32/99309_2.png) [@ryancey](https://meta.discourse.org/u/ryancey)
#### Post date: [March 1, 2019, 10:59am UTC](https://meta.discourse.org/t/allow-user-creation-via-api-when-enable-local-logins-is-disabled/110431/1 "2019-03-01T10:59:10Z")

</div>

I’d like to pre-create user accounts, while at the same time only allow OAuth2 logins in the front-end. The more precise goal is to dismiss the _Create user account_ window when the users log in via OAuth2.

If I disable local logins, the API rejects the user creation.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 3, 2019, 11:12pm UTC](https://meta.discourse.org/t/allow-user-creation-via-api-when-enable-local-logins-is-disabled/110431/2 "2019-03-03T23:12:29Z")

</div>

I would just temporarily disable the site setting via API, stage the account, then turn the setting on via the API.

Hide the various bits for the sign up form just in case a user tries to log in when you are doing this thing.
