# Error using discourse-oauth2-basic plugin with NeonCRM

**URL:** <https://meta.discourse.org/t/error-using-discourse-oauth2-basic-plugin-with-neoncrm/132596>\
**Category:** SSO\
**Tags:** oauth2\
**Created:** [November 5, 2019, 12:18am UTC](https://meta.discourse.org/t/error-using-discourse-oauth2-basic-plugin-with-neoncrm/132596 "2019-11-05T00:18:43Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Denis\_Heraud](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denis_heraud/32/119623_2.png) [@Denis\_Heraud](https://meta.discourse.org/u/Denis_Heraud)\
**Post date:** [November 5, 2019, 12:18am UTC](https://meta.discourse.org/t/error-using-discourse-oauth2-basic-plugin-with-neoncrm/132596/1 "2019-11-05T00:18:43Z")

</div>

I’m trying to set up the discourse-oauth2-basic plugin so that our users can sign into our Discourse forum using their account credentials created and stored through NeonCRM.

A NeonCRM support tech explained to me that I can create the authorization URL manually using this format:

https://{{Org ID}}.z2systems.com/np/oauth/auth?response\_type=code&client\_id={{Client ID}}&redirect\_uri={{Redirect URL}}

In Discourse, I set the following parameters for the plugin:

oauth2 client id: MY-CLIENT-ID  
oauth2 client secret: MY-CLIENT-SECRET  
oauth2 authorize url: [https://MY-NEON-ID.z2systems.com/np/oauth/auth](https://MY-NEON-ID.z2systems.com/np/oauth/auth)  
oauth2 token url: [https://www.z2systems.com/np/oauth/token](https://www.z2systems.com/np/oauth/token)

So I manually created this URL (which I censored):

[https://MY-NEON-ID.z2systems.com/np/oauth/auth?response\_type=code&client\_id=MY-CLIENT-ID&redirect\_uri=https://MY-FORUM.COM/auth/oauth2\_basic/callback](https://MY-NEON-ID.z2systems.com/np/oauth/auth?response_type=code&client_id=MY-CLIENT-ID&redirect_uri=https://MY-FORUM.COM/auth/oauth2_basic/callback)

And when I enter this URL in a browser, I get a Discourse page with the following message:

 ![15](https://global.discourse-cdn.com/meta/original/3X/a/4/a482603d64144ac4b549e4cfd6702af36da26c2d.png)

And my logs say:

```
(oauth2_basic) Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected

```

Why?

---

_[View the full topic](https://meta.discourse.org/t/error-using-discourse-oauth2-basic-plugin-with-neoncrm/132596)._
