Authenticating with .NET Core 2.0 MVC Application

Hello to the Patreon Developer Community!

I’m a Patreon Creator and I am trying to integrate my own personal website with the Patreon Oath2 API.

My website is written in .NET Core 2.0 MVC and I’ve managed to get it to redirect to the Patreon Login page with the appropriate client id and secret id as specified in the API documentation. Login is successful and Patreon redirects successfully to the redirect URI provided back to my web application sending a Code and a State.

This is where the problem lies. The following step according to the API documentation is to make an additional HTTP POST with the following Query:

POST www.patreon.com/api/oauth2/token
?code=<single use code, as passed in to GET route [2]>
&grant_type=authorization_code
&client_id=
&client_secret=
&redirect_uri=<redirect_uri>

Providing the code that we received after the login process.

Unfortunately every time I get an UNAUTHORISED result:

{
“error”: “access_denied”
}

I would appreciate any assistance from anyone with similar experience.

Best Regards

1 Like

Hey there! Just to double check, are you filling in your client_id and client_secret when you make the request?

If so, that’s pretty strange that you’re getting access denied! Any other detail you can provide would be great.

1 Like