# How to skip "Create New Account" window when using custom ManagedAuthenticator + OmniAuth strategy?

**URL:** https://meta.discourse.org/t/how-to-skip-create-new-account-window-when-using-custom-managedauthenticator-omniauth-strategy/155579
**Category:** Development
**Created:** [June 22, 2020, 3:18pm UTC](https://meta.discourse.org/t/how-to-skip-create-new-account-window-when-using-custom-managedauthenticator-omniauth-strategy/155579 "2020-06-22T15:18:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Hooksmith](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hooksmith/32/142826_2.png) [@Hooksmith](https://meta.discourse.org/u/Hooksmith)
#### Post date: [June 22, 2020, 3:18pm UTC](https://meta.discourse.org/t/how-to-skip-create-new-account-window-when-using-custom-managedauthenticator-omniauth-strategy/155579/1 "2020-06-22T15:18:41Z")

</div>

I’ve implemented a custom OmniAuth strategy + an authenticator that extends Discourse’s Auth::ManagedAuthenticator.

However, when testing this in my development environment, I eventually end up on this screen, rather than immediately being logged in:

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/d/cdbdb67693fbb8e544688bf5008dabfc73fbf137.png)

The information is filled out correctly from the auth hash, however, I do not want users to be able to change their username or name here. How do I change my implementation / forum settings so that this screen is skipped and the user account is immediately created (if not existing) and logged in?

**Authenticator:**

```ruby
class MyAuthenticator < ::Auth::ManagedAuthenticator

    def name
        'my_authenticator'
    end

    def enabled?
        true
    end

    def register_middleware(omniauth)
        omniauth.provider name.to_sym, {}
    end
    
end

```

**Strategy:**

```ruby
require 'omniauth'

...

class OmniAuth::Strategies::MyAuthenticator
    include OmniAuth::Strategy

    option :name, "my_authenticator"

    ...

    def callback_phase
        ...

        @user_id = ...
        @username = ...
        @avatar = ...
        @email = ...

        ...
    end
	
	...
	
    def auth_hash
        {
            provider: "my_authenticator",
            uid: @user_id,
            info: {
                name: @username,
                image: @avatar,
                email: @email
            },
            extra: {}
        }
    end

end

OmniAuth.config.add_camelization('my_authenticator', 'MyAuthenticator')

```

**plugin.rb:**

```ruby
before_auth do
    ...

    auth_provider authenticator: MyAuthenticator.new()

    ...
end

```

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [June 22, 2020, 5:01pm UTC](https://meta.discourse.org/t/how-to-skip-create-new-account-window-when-using-custom-managedauthenticator-omniauth-strategy/155579/2 "2020-06-22T17:01:12Z")

</div>

This is coming in a few weeks

[https://github.com/discourse/discourse/pull/10082](https://github.com/discourse/discourse/pull/10082)

---

<div class="post-metadata">

### Author: ![Hooksmith](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hooksmith/32/142826_2.png) [@Hooksmith](https://meta.discourse.org/u/Hooksmith)
#### Post date: [June 22, 2020, 5:36pm UTC](https://meta.discourse.org/t/how-to-skip-create-new-account-window-when-using-custom-managedauthenticator-omniauth-strategy/155579/3 "2020-06-22T17:36:22Z")

</div>

So reading through the PR, it looks like this can be turned on just by toggling settings, and it wouldn’t require a code change to the custom authenticator once this releases, right?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [June 22, 2020, 5:41pm UTC](https://meta.discourse.org/t/how-to-skip-create-new-account-window-when-using-custom-managedauthenticator-omniauth-strategy/155579/4 "2020-06-22T17:41:05Z")

</div>

Exactly. I believe @david plan is to merge a week or two after we [release 2.5](https://meta.discourse.org/t/discourse-version-2-5/125302) on 2020-06-25T03:00:00Z

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [July 6, 2020, 11:09am UTC](https://meta.discourse.org/t/how-to-skip-create-new-account-window-when-using-custom-managedauthenticator-omniauth-strategy/155579/5 "2020-07-06T11:09:42Z")

</div>

This is now merged

> [@Automatically provision accounts with external SSO provider? (skip Create New Account prompt)](https://meta.discourse.org/t/automatically-provision-accounts-with-external-sso-provider-skip-create-new-account-prompt/134511/6):
>
> I just added some new site settings which will help with this. To skip the ‘create new account’ screen, enable sso\_overrides\_username, sso\_overrides\_email and sso\_overrides\_name. Then to skip the popup completely, enable external\_auth\_skip\_create\_confirm If you don’t see that option, make sure you’re on the latest version of tests-passed.
