# Auth plugin interface in 2.1.0

**URL:** https://meta.discourse.org/t/auth-plugin-interface-in-2-1-0/97223
**Category:** Development
**Created:** [September 14, 2018, 10:28pm UTC](https://meta.discourse.org/t/auth-plugin-interface-in-2-1-0/97223 "2018-09-14T22:28:43Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![VojtechMyslivec](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vojtechmyslivec/32/111148_2.png) [@VojtechMyslivec](https://meta.discourse.org/u/VojtechMyslivec)
#### Post date: [September 14, 2018, 10:28pm UTC](https://meta.discourse.org/t/auth-plugin-interface-in-2-1-0/97223/1 "2018-09-14T22:28:44Z")

</div>

Hello,

I use [discourse-mojeid](https://github.com/CZ-NIC/discourse-mojeid) authentication plugin based on `OpenIdAuthenticator`.

This plugin is not compatible with Discourse 2.1.0 and I want to fix this. I found a [commit](https://github.com/discourse/discourse/commit/eda1462b3b8f57aace0c49b1d64edfcf3d1f45b2), which changes the interface (constructor?) of `OpenIdAuthenticator`, but I cannot find the documentation for this feature.

It seems third `string` parameter is missing in my `discourse-mojeid` which should point to some class method. I am not sure what should this parameter do, how should I use it or where to implement this method.

I don’t need any configuration option to enable/disable this plugin. I just want to install it and use it.

Does anyone have an idea?

---

<div class="post-metadata">

### Author: ![VojtechMyslivec](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vojtechmyslivec/32/111148_2.png) [@VojtechMyslivec](https://meta.discourse.org/u/VojtechMyslivec)
#### Post date: [September 18, 2018, 12:38pm UTC](https://meta.discourse.org/t/auth-plugin-interface-in-2-1-0/97223/3 "2018-09-18T12:38:42Z")

</div>

Anyone has an idea? I would be satisfied for the point to the documentation or usage example. I cannot find any.

---

<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 18, 2018, 1:09pm UTC](https://meta.discourse.org/t/auth-plugin-interface-in-2-1-0/97223/4 "2018-09-18T13:09:02Z")

</div>

The plugin needs to be updated for the changes. If the original developer isn’t maintaining the plugin, you could always create your own fork of it.

OpenIDAuthenticator now requires a third parameter, which should be the site setting corresponding to the auth provider. You can see an example in core (the setting is `enable_yahoo_logins`):

> <https://github.com/discourse/discourse/blob/a713c0d3661bdbceae584359033cbf9fa7018592/lib/discourse.rb#L217>

So the plugin needs to:

1. Add a site setting, some instructions for this can be found [here](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-3-custom-settings/31115)
2. Add the name of that site setting as the third parameter to `OpenIdAuthenticator`

---

<div class="post-metadata">

### Author: ![VojtechMyslivec](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vojtechmyslivec/32/111148_2.png) [@VojtechMyslivec](https://meta.discourse.org/u/VojtechMyslivec)
#### Post date: [September 18, 2018, 4:03pm UTC](https://meta.discourse.org/t/auth-plugin-interface-in-2-1-0/97223/5 "2018-09-18T16:03:14Z")

</div>

Thank you for the reply. I really appreciate the link I haven’t found before.

I have no problem to fork it. Because, I guess, this plugin is probably used only by us, I have become the maintainer anyway.

Is this `enable` option really a must? It wasn’t required before and the discussion in the [pull request](https://github.com/discourse/discourse/pull/6099#issuecomment-405860871) reads:

> Changes are 100% backwards compatible, but new features will not work for plugins until they are updated.

The plugin is really simple and I don’t want to complicate it unnecessarily.

Thanks

---

<div class="post-metadata">

### Author: ![VojtechMyslivec](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vojtechmyslivec/32/111148_2.png) [@VojtechMyslivec](https://meta.discourse.org/u/VojtechMyslivec)
#### Post date: [September 18, 2018, 8:21pm UTC](https://meta.discourse.org/t/auth-plugin-interface-in-2-1-0/97223/6 "2018-09-18T20:21:32Z")

</div>

Alright @David, it seems I have [handled it](https://github.com/VojtechMyslivec/discourse-mojeid).

Would you be so kind and take a look at my “fix”? If the implementation at the moment looks like it should?

---

<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 19, 2018, 6:57am UTC](https://meta.discourse.org/t/auth-plugin-interface-in-2-1-0/97223/7 "2018-09-19T06:57:25Z")

</div>

At a glance that looks good. Technically you do not need `client: true` on the site setting, but it won’t cause any harm.

---

<div class="post-metadata">

### Author: ![VojtechMyslivec](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vojtechmyslivec/32/111148_2.png) [@VojtechMyslivec](https://meta.discourse.org/u/VojtechMyslivec)
#### Post date: [September 19, 2018, 8:30am UTC](https://meta.discourse.org/t/auth-plugin-interface-in-2-1-0/97223/8 "2018-09-19T08:30:54Z")

</div>

I see. Thank you very much!
