我正在尝试使用 Auth0 为 Reddit 创建自定义社交连接。到目前为止,这是我设置的内容:
我还实现了以下获取用户配置文件脚本:
function(accessToken, ctx, cb) {
request.get('https://oauth.reddit.com/api/v1/me', {
headers: {
'Authorization': 'Bearer ' + accessToken,
'User-Agent': 'Auth0/1.0'
}
}, 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);
cb(null, {
user_id: profile.id,
username: profile.name,
email: profile.email || ''
});
});
}
但是,当我尝试连接时,出现以下错误:
{
"error": "invalid_request",
"error_description": "the connection is not enabled"
}
我不确定我需要在自定义标题中插入什么。我找到了这篇文章,但我仍然无法定义用户配置文件脚本和自定义标头。任何帮助将不胜感激。