# Confused about OAUTH

**URL:** <https://www.patreondevelopers.com/t/confused-about-oauth/2436>\
**Category:** Friendly Help\
**Created:** [November 13, 2019, 6:02pm UTC](https://www.patreondevelopers.com/t/confused-about-oauth/2436 "2019-11-13T18:02:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Natro](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@Natro](https://www.patreondevelopers.com/u/Natro)\
**Post date:** [November 13, 2019, 6:02pm UTC](https://www.patreondevelopers.com/t/confused-about-oauth/2436/1 "2019-11-13T18:02:54Z")

</div>

Hey!

I’m new to working with oauth etc.

- working with API in general.  
So please keep that in mind.

I created a Discord Bot that includes a shop and some custom items.  
I would like to reward my patrons with items on Discord and not doing it manually

- getting patron’s Discord ID (I believe api gives you user’s discord information, fix me if I’m wrong)

I read through Patreon API Documentation and I am stuck on oauth part.  
If I understood it correctly - I need to have button somewhere on my website  
to authenticate the user.  
What if I don’t have a website? Can I by any chance  
have users authenticate when they pledge?  
Or am I completely not understanding the concept?

Big thank you in advance to anyone  
who helps me understand this!

Sebastian

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [November 13, 2019, 6:48pm UTC](https://www.patreondevelopers.com/t/confused-about-oauth/2436/2 "2019-11-13T18:48:12Z")

</div>

To have users login (or connect their account) via Patreon, you will need to have a way to initialize the oAuth login process.

It doesnt matter how you start it as long as you send the user to permission flow, and then get the user’s info via oAuth at the end. Including tokens.

This may be started via a link, via a button, or via an automatic redirect, in however way which your app can receive the info sent by the API. (access and refresh tokens and their details at the end).

To see a working example of this, you can test drive Patreon’s WP plugin

> **[Patreon WordPress](https://wordpress.org/plugins/patreon-connect/)**
>
> Connect your WordPress site and your Patreon to increase your patrons and pledges!
> 
> With Patreon WordPress, you can bring Patreon features to your Wor …

It has oAuth login and pledge/unlock flows built in. The code within it also shows how you can integrate these stuff.

Patreon PHP lib is a much more minimalist and easier lib to examine and take as an example on how to build such an oAuth login or pledge flow, however:

> **[Patreon/patreon-php](https://github.com/Patreon/patreon-php)**
>
> Interact with the Patreon API via OAuth. Contribute to Patreon/patreon-php development by creating an account on GitHub.
