# Bypass the account creation modal when using OAuth2

**URL:** <https://meta.discourse.org/t/bypass-the-account-creation-modal-when-using-oauth2/110123>\
**Category:** Product Support\
**Created:** [26 בפברואר,‏ 2019,‏ 1:23pm UTC](https://meta.discourse.org/t/bypass-the-account-creation-modal-when-using-oauth2/110123 "2019-02-26T13:23:56Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [1 במרץ,‏ 2019,‏ 10:40am UTC](https://meta.discourse.org/t/bypass-the-account-creation-modal-when-using-oauth2/110123/5 "2019-03-01T10:40:57Z")

</div>

> [@RGJ](#):
>
> Take a look at this [Disable “create account” screen for CAS logins](https://meta.discourse.org/t/disable-create-account-screen-for-cas-logins/11334/4) . You should be able to do something similar. I have no idea why this is not a default feature.

I modified `discourse-oauth2-plugin` to create the user account in the `after_authenticate` hook but the modal still pops and the suggested username is a variation of the OAuth2 username (because, eh, it’s already taken at this point).

I’m not familiar enough with Discourse (and Rails) to dig this, so if anyone could tell me if there is an “easy” way to dismiss this modal, other than forking `discourse/discourse` if possible…

> [@pfaffman](#):
>
> You really want SSO. That way the other server controls everything. With oauth the user can still choose a username.

SSO would make me implement another auth endpoint on my OAuth2 server and I’d prefer not to, to keep consistency with the other apps using OAuth2 in the stack.

---

_[View the full topic](https://meta.discourse.org/t/bypass-the-account-creation-modal-when-using-oauth2/110123)._
