# Discourse, Keycloak, SAML vs OAuth

**URL:** https://meta.discourse.org/t/discourse-keycloak-saml-vs-oauth/165187
**Category:** Support
**Created:** [September 24, 2020, 7:56am UTC](https://meta.discourse.org/t/discourse-keycloak-saml-vs-oauth/165187 "2020-09-24T07:56:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![nahimov](https://avatars.discourse-cdn.com/v4/letter/n/aca169/32.png) [@nahimov](https://meta.discourse.org/u/nahimov)
#### Post date: [September 24, 2020, 7:56am UTC](https://meta.discourse.org/t/discourse-keycloak-saml-vs-oauth/165187/1 "2020-09-24T07:56:07Z")

</div>

Hello @david!  
Are there any changes since this topic?

> [@Configure OneLogin's SAML for Discourse](https://meta.discourse.org/t/configuring-onelogins-saml-for-discourse/68295):
>
> Here’s how to configure Discourse to allow login and registration with OneLogin’s SAML. Configure OneLogin Create OneLogin account Go to [OneLogin](https://www.onelogin.com/) and create an account. Create new app: SAML Test Connector (IdP w/attr) From your dashboard create new app. Search for SAML Test Connector (IdP w/attr) Configure app Let’s assume that the URL of our Discourse instance is http://discourse.example.com. Let’s configure it. Switch to Configuration tab and fill out these details…

I am interested in this:

```plaintext
With OAuth2 Basic Plugin have one BIG problem - if the user is new to Discourse, then, after authentication, a window appears with the data of the new user.

```

The SAML plugin has an option `DISCOURSE_SAML_AUTO_CREATE_ACCOUNT`.  
But what about `OAuth2` plugin?

---

<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: [September 24, 2020, 8:27am UTC](https://meta.discourse.org/t/discourse-keycloak-saml-vs-oauth/165187/2 "2020-09-24T08:27:47Z")

</div>

Yes you can use this new setting:

> [@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.

---

<div class="post-metadata">

### Author: ![nahimov](https://avatars.discourse-cdn.com/v4/letter/n/aca169/32.png) [@nahimov](https://meta.discourse.org/u/nahimov)
#### Post date: [September 24, 2020, 8:34am UTC](https://meta.discourse.org/t/discourse-keycloak-saml-vs-oauth/165187/3 "2020-09-24T08:34:59Z")

</div>

> [@david](#):
>
> Yes you can use this new setting:

Great! Thanks.  
Is there any guides how to integrate Keycloak and Discourse OAuth2 plugin? Or other IDP…

---

<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: [September 24, 2020, 8:39am UTC](https://meta.discourse.org/t/discourse-keycloak-saml-vs-oauth/165187/4 "2020-09-24T08:39:32Z")

</div>

I would suggest starting with

> [@Discourse OpenID Connect (OIDC)](https://meta.discourse.org/t/openid-connect-authentication-plugin/103632):
>
> discourse2Summary Discourse OpenID Connect allows an OpenID Connect provider to be used as an authentication provider for Discourse.open_bookInstall Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately. Features The plugin aims to provide a minimal implementation of [the specification](https://openid.net/specs/openid-connect-basic-1_0.html). Specifically, it supports the “Authorization Code Flow”. To get started, follow [the plugin installation instructions](https://meta.discourse.org/t/install-plugins-in-discourse/19157), or contact your hosti…

And finding the openid discovery document URL using [these instructions](https://www.keycloak.org/docs/latest/securing_apps/#endpoints-2)
