-
Notifications
You must be signed in to change notification settings - Fork 7
Integrating HID with Auth0
Guillaume Viguier-Just edited this page Oct 14, 2019
·
8 revisions
Integrating HID with Auth0 is relatively straightforward. Here is what you will need to do:
- Follow the Auth0 documentation to add a new custom social connection: https://auth0.com/docs/connections/social/oauth2
- Create a new custom social connection with the following parameters:
- Name: Humanitarian Id
- Client ID: client ID provided by the HID team
- Client secret: client secret provided by the HID team
- Authorization URL: https://auth.humanitarian.id/oauth/authorize
- Token URL: https://auth.humanitarian.id/oauth/access_token
- Scope: profile
- Fetch User Profile Script
function(access_token, ctx, callback) {
request.get('https://auth.humanitarian.id/account.json', {
'headers': {
'Authorization': 'Bearer ' + access_token,
'User-Agent': 'Auth0'
}
}, function(e, r, b) {
if (e) return callback(e);
if (r.statusCode !== 200) return callback(new Error('StatusCode:' + r.statusCode));
var profile = JSON.parse(b);
delete profile._id;
callback(null, profile);
});
}
- Save and try the new connection