0

I am trying to use the Patreon API.

I already have the Client ID and the Client Secret etc.

When I open the oauth url with the client id and client secret passed into it. e.g.

var url = 'https://www.patreon.com/oauth2/authorize?response_type=code&client_id=' + clientid +'&redirect_uri=' + redirecturl +'&scope=<optional list of requested scopes>&state=<optional string>'

I do not get to page that allows me to login with my Patreon account but instead I go to the redirect URL with some parameters passed into it:

e.g. http://localhost:3000/?error=invalid_scope&state=%3Coptional+string%3E

What does this mean and what am I doing wrong?

preston
  • 3,721
  • 6
  • 46
  • 78

1 Answers1

1

error=invalid_scope usually means that the value of parameter scope in your request was incorrect. This parameter is optional, so you can easily omit it.

But if you need some custom scope, documentation suggests writing to Patreon support.

Community
  • 1
  • 1
Eugene Primako
  • 2,767
  • 9
  • 26
  • 35
  • Hi You are right....I removed the scope and state parameter and now it is working... – preston Jun 26 '18 at 00:26
  • Now I get a code passed into the redirect url e.g. http://localhost:3000/?code=uPp3vLLUcA2w6VNmrKzKkkdblPaJi9&state=None How do I use that code using Javascript???? – preston Jun 26 '18 at 00:32
  • @preston I'd suggest doing it on serverside (not to make client_secret public) or using ```response_type=token```. – Eugene Primako Jun 26 '18 at 09:26
  • Hi. How do we add scpe (users pledges-to-me my-campaign) to the URL. How do we count for the spaces, etc ? This wont work... &scope=users pledges-to-me my-campaign&redire..... – GaddMaster Jun 30 '20 at 12:59
  • 1
    @GaddMaster Hi, you should urlencode (https://en.wikipedia.org/wiki/Percent-encoding) your param values: `&scope=users%20pledges-to-me%20my-campaign&redire...` – Eugene Primako Jun 30 '20 at 15:15