Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update LinkedIn to use new lite profile #391

merged 6 commits into from Mar 5, 2019
Changes from 1 commit
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.


Just for now

Fixes linkedin profile requests

  • Loading branch information
dawnerd committed Feb 26, 2019
commit b874e424ce742aed651aef1e138dd3dd5f0b767c
@@ -2,8 +2,6 @@

// Load modules

const Crypto = require('crypto');

// Declare internals

@@ -15,37 +13,31 @@ exports = module.exports = function (options) {
return {
protocol: 'oauth2',
useParamsAuth: true,
auth: '',
token: '',
auth: '',
token: '',
scope: ['r_liteprofile', 'r_emailaddress'],
scopeSeparator: ',',
profile: async function (credentials, params, get) {

const query = {
format: 'json',
appsecret_proof: Crypto.createHmac('sha256', this.clientSecret).update(credentials.token).digest('hex')

let fields = '';
if (this.providerParams && this.providerParams.fields) {
fields = '?projection=' + this.providerParams.fields;

const profile = await get('' + fields, query);
const email = await get('*(handle~))', query);
const profile = await get('' + fields);
const email = await get('*(handle~))');

credentials.profile = {
name: {
first: profile.firstName.localized[Object.keys(profile.firstName.localized)[0]],
last: profile.lastName.localized[Object.keys(profile.lastName.localized)[0]]
email: email['handle~'].emailAddress,
email: email.elements[0]['handle~'].emailAddress,
This conversation was marked as resolved by AdriVanHoudt

This comment has been minimized.

Copy link

dawnerd Feb 27, 2019

Author Contributor

Yeah that's what I referred to about their docs being wrong. They send back an elements array.

This comment has been minimized.

Copy link

AdriVanHoudt Mar 1, 2019


That's... something haha

raw: {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.