Configuring Patreon integration with Discourse

Currently unable to get any of the tests to work.
Both deprecated, and current tests fail with the same error.
image

Manual navigation to the page shows a CSRF error.
Authorization timed out, or you have switched browsers. Please try again.

The docker container is sitting behind an nginx reverse proxy.

    server {
            listen 443 ssl;
            ssl_certificate /etc/letsencrypt/live/security-nerds.net/fullchain.pem; # managed by Certbot
            ssl_certificate_key /etc/letsencrypt/live/security-nerds.net/privkey.pem; # managed by Certbot
            include /etc/letsencrypt/options-ssl-nginx.conf;
            ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
            access_log /var/log/nginx/reverse-access.log;
            error_log /var/log/nginx/reverse-error.log;
            server_name security-nerds.net;
            location / {
              proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
              proxy_set_header Host $http_host;
              proxy_http_version 1.1;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header X-Forwarded-Proto https;
              proxy_set_header X-Real-IP $remote_addr;
            }

All other plugins, extensions, navigation works properly though.
The plugin also properly pulls the tier information from Patreon properly.

1 Like

The webhook URL should be https://forum.example.com/patreon/webhook. The URL you’ve put in there is for “Login with Patreon” in the “OAuth2 Authorized Redirects”.

6 Likes

Yup, that squashed the error, I guess I wasn’t paying enough attention. The tests run now without displaying anything, which I’m guessing in intended?

I’ll wait a while and see if users start popping up in the Patreon group.

1 Like

So I have multiple patreon pages cuz i have a multiple community so is there anyway i can link up multiple patreon pages to discourse?

2 Likes

Nope. At least not yet. You can read more just above:

2 Likes

Hi - I’m trying to set up my Patreon integration so that ONLY Patrons at a certain reward tier can register. All I’ve found is that I can spec a code that they need to enter, but that’s not efficient.

Also, I’d like Patrons to automatically be assigned a badge that denotes their reward tier when they register.

Halp?
Thanks.
Amy

2 Likes

There is no way to limit registrations to users at a certain reward tier, but you can limit what Discourse content can be accessed based on the user’s Patreon tier. This makes it possible to keep non-patrons from seeing any content on the site. To set this up, you need to limit access to all categories on your site to members of the Discourse groups that you have associated with Patreon.

For details about setting up category security permissions, see How to use category security settings to create private categories.

To associate Discourse groups with Patreon tiers, go to your site’s /admin/plugins/patreon page. Here’s a screenshot of that page from my site. I have it configured so that all patrons get added to the ‘patrons’ group and members of my ‘supporters’ tier get added to the ‘walking’ group:

If you configure Patreon login for your site, you can make Patreon login the only login method for your site. To do this, first make sure that Patreon login is working correctly for you, then disable the enable local logins and enable local logins via email site settings. With this done, only users with Patreon accounts will be able to login to your site. People with Patreon accounts who are not your supporters will still be able to login and create accounts though.

This should work for the ‘patrons’ group that is added by the plugin without any configuration on your part. Users who are added to that group will have the Patreon avatar flair added to their avatar. To configure other groups that you’ve associated with Patreon to add an avatar flair, have a look at this topic: Create a group that automatically adds associated flair to its members' avatars

7 Likes

Hi! After installing & setting everything up test seems to work fine, but after that on patreon the webhook is paused.

Any ideas?

1 Like