Install the Custom Social Connections extension in your dashboard and follow the steps as described in https://auth0.com/docs/extensions/custom-social-extensions
Last active
June 17, 2019 12:41
-
-
Save fbaiodias/1f9703a692d7797ea1d193406d7f6afc to your computer and use it in GitHub Desktop.
Using Typeform.com account as an Auth0 Custom Social Connection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (access_token, ctx, callback) { | |
request.get('https://api.typeform.com/me', { | |
headers: { | |
Authorization: 'Bearer ' + access_token, | |
'User-Agent': 'Auth0' | |
} | |
}, function (err, res, body) { | |
if (err) { | |
return callback(err) | |
} | |
if (res.statusCode !== 200) { | |
return callback(new Error('StatusCode:' + r.statusCode)) | |
} | |
const profile = JSON.parse(body) | |
profile.user_id = profile.user_id || profile.email | |
profile.email_verified = true | |
callback(null, profile) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment