Patreon Integration

I’ve been looking around, but I can’t find any plugin that rewards patrons every month.

Some ideas:

  • Items
  • Ranks
  • Commands ran when giving rewards, e.g. a permanent speed boost

You’re unlikely to see one, because Patreon’s API requires an external OAuth server, which means someone is going to have to spend the money to host one.

That seems wrong - looking at Patreon’s docs, developers just need an OAuth client to access their server: API Reference

Once you submit the OAuth application on their end, they redirect to your own server with the token and context. You configure the URL they redirect to when you create the API application. This means you have to have a URL to redirect to.

Although it would be pretty trivial to have a plug-in that hosts the webserver on it to handle the return responses… The challenge arrises in the fact that many hosts don’t give you a dedicated IP, or multiple ports.

Wait, what awful host wouldn’t give you a dedicated IP or multiple ports? Isn’t the point of a host to give you access to a Linux machine with full access? I can do whatever I want on my server.

EDIT:
Also, you can just make a request to the Application with a fake url and check what URL it redirects you to by looking at the 301 response and parse that as far as I’m aware.

I should rephrase that… a lot of minecraft server hosts (not VPS or dedis or bare metal) tend to have minecraft servers share IPs because IPv4s are relatively expensive, and hard to get. They also tend to not be very willing to open up a spare port to your server (because they really jam the servers together). These tend to be cheaper hosts that are exclusively in the minecraft hosting business (sometimes they will offer a dedicated IP for like 10$ more a month or something).

If you go through a decent (imho) hosting company, you should be basically able to own your server, and do what you want with it… most of the time it comes down to how much you want to pay.

Tbh, I haven’t really looked too too much into other minecraft server hosts, and I am sure there are a lot that give you a dedicated IP and stuff, but yeah.

In response to your edit…as far as I know, you absolutely cannot do that… unless for some reason that’s how patreon set up their oauth… I sincerely doubt that though.

-edit- it is midnight btw, and i have been up since 4am, so I might be really FOS at this point… I’ll check back in the morning to verify my info…

Just checked, once an Application is made (with fake url like https://fakeurl.com), you will have access to a Client ID, Client Secret, Access Token and Refresh Token. These, in turn, can be used in the Patreon Library for java to fetch Patron information.

Yes… But when it’s actually authenticated i don’t think the way the oauth lifecycle works will allow it to actually succeed at that…

Right. You may be able to fetch patron information, but you won’t be able to match a patron to a Minecraft user.

Is it not possible to give each user an authorization link that just sends the linked account name to the server?

Sends it to the server how? Like I said, you need a webserver to receive the information.

Basically the problem is, in most oauth implementations, for security, you can only have a callback url set in the application, it’s not something passed on to each request. You don’t just send data and magically get it back.

You would basically have to have a webserver running gin order to get access to it. Now running a web server is dead simple, and implementing an Oauth client wouldn’t be to hard either, but its a more complicated setup…

The easier way to do this would be if someone made an external service that handles this, and then a plug-in/API bridge that can be used to get limited information.