Hey,’
I am trying to create a custom social connection for reddit. My settings are:
Auth URL: reddit.com: Log in
Client ID:
Secret:
Token URL: https://www.reddit.com/api/v1/access_token
Scope:
identity
Fetch user profile script:
function(accessToken, ctx, cb) {
request.get(‘https://oauth.reddit.com/api/v1/me’, {
headers: {
‘Authorization’: 'Bearer ’ + accessToken
}
}, function(e, r, b) {
if (e) return cb(e);
if (r.statusCode !== 200) return cb(new Error('StatusCode: ’ + r.statusCode));
var profile = JSON.parse(b).data;
profile.user_id = profile.id;
cb(null, profile);
});
}
Custom headers:
{
“Authorization”: “Basic <MY AUTH BASE 64 STRING>”
This correctly gets me to reddit authorization page and lets me allow, but fails with “invalid_grant” “Invalid authorization code”.
Which from here the docs say:
invalid_grant
The code
has expired or already been used Ensure that you are not attempting to re-use old code
s - they are one time use.
Would the custom social connection somehow be reusing an old code? Anyone gotten this to work?