Request failed due to failure of previous request: Connecting 2 reddit with HTTP “Make an OAuth 2.0 request”?

Follow up to a previous thread about trying to connect to reddit using the HTTP Make an OAuth 2.0 Request

Im running in to a new issue where Im returned an error message saying:

The request failed due to failure of a previous request

code: SC424

Furthermore I tried creating a different App from 2 different user accounts, I wonder if im blocked somehow.

I also tried using a refresh token parameter with
key: grant_type
value: refresh_token

But at this point i have no idea.

Github Source that reddit links to about OAuth2, their own API documentation does not mention OAuth2:

These are my settings currently:


These are my latest settings:
Connection name:
My HTTP OAuth 2.0 connection | Reddit
Flow Type: Authorization Code
Authorize URI: https://www.reddit.com/api/v1/authorize
Token URI: https://www.reddit.com/api/v1/access_token
Scope: read
Client ID: MY CLIENT ID
Client Secret: MY CLIENT SECRET

Authorize parameters:
response_type: code
redirect_uri: https://www.integromat.com/oauth/cb/oauth2
client_id: MY CLIENT ID

Access token parameters
grant_type: authorization_code
client_id: MY CLIENT ID
client_secret: MY CLIENT SECRET

Refresh Token Parameters:
grant_type: refresh_token

Custom Headers:
User-Agent: web:MakeAPICalls:v1.0 (by /u/username)
Token placement: in the header
Header token name: Bearer

I have finally found the solution to this (previous thread: How to create a connection to Reddit Using the "Make an OAuth 2.0 request"?) @Michaela I wanted to edit that thread with a link to this one so users see that I have a complete solution to connect to reddit via HTTP Oauth 2.0, but anyway to the solution:

Ensure to use the same redirect URI in your Reddit custom app setup.
image

In the ‘Custom headers’, an Authorization header needs to be created in this format:

Now, to get the base64 encoded string, you can use a ‘Set Variable’ module with the base64() function (the encoded string will always be a constant so no need to worry) :
image

This worked for me and I have finally setup an authorized connection to Reddit through make.

3 Likes

Hey there @LeftyLuke :blob_wave:

Thank you for sharing this solution with us and congratulations on solving this puzzle on your own!

Keep up the great work!

2 Likes