Hey @Sebastian_Schaeffer - I’m consulting these docs here, but let me know if you’re looking at something else, they might have some newer docs I’m not finding.
First, make sure to select “OAuth 2.0” from the Authentication dropdown.
Let me know how that goes. If you’re encountering an error, reply back with a screenshot (with private info blurred out) and we can take a closer look!
thanks for this! After adding everything you wrote in your post I got this error:
An error occurred during authorization: Access token URL returned a 429 when making a request for the access token. More data here: b’{“message”: “Too Many Requests”, “error”: 429}’
This happens right after the auth screen that reddit shows where it asks me if I want to give permission to read my posts etc.
After some googling it noticed that the API requires a user-agent so I added a user-agent header. Now I am getting this error:
An error occurred during authorization: Access token URL returned a 401 when making a request for the access token. More data here: b’{“message”: “Unauthorized”, “error”: 401}’
I am not sure why this is happening…I tried adding an Authentication header like this: “basic clientid:secret” but that also didn’t work so now I am a bit lost Any ideas?
Hm, this is a strange error message. We’ll need to take a moment to troubleshoot this on our end. OAuth2 can be tricky depending on the service you’re using.
In the meantime, would you try re-adding a custom header to the second step? The key should be Authorization and the value should be Basic client_id:client_secret. You may need to base64 encode your the part where it says client_id:client_secret.
To do that, insert your client_id and client_secret as you normally would. Then paste that string into this site and select encode. Grab that value and exchange that in your Authorization value.
Let me know if that provides different results, and we’ll keep looking into it on our end.
This actually got me one step further! So it must be the base64 encoding that was missing…my mistake. I thought parabola would take care of that.
Now I run into this error
An error occurred during authorization: Access token URL returned a 400 when making a request for the access token. More data here: b’{“explanation”: “request contains duplicate parameter for oauth2: code”, “message”: “Bad Request”, “reason”: “OAUTH2_DUPLICATE_PARAMS”}’
Unfortunately, it looks like we won’t be able to connect to Reddit’s API via OAuth at the moment.
I attempted to authenticate a personal account by using the same steps listed above. Both a User-Agent header key and Authorization key with a base64 encoded client_id and client_secret were added to the request.
The same error code was returned to me also stating there were duplicate parameters within our JSON body. I’m not certain, but this may be linked to how Reddit generates a URL after the request is sent for an access token, causing a duplicative value along the way.
If we decide to update our OAuth module to connect with Reddit, we’ll be sure to let you know in the future!