Add support for azure ad b2c auth

pull/7052/head
l.fernandes 4 months ago
parent ece5753ebb
commit f45d822b28

@ -37,12 +37,16 @@ module.exports = {
useCookieInsteadOfSession: keyArray.length > 0,
cookieEncryptionKeys: keyArray
}, async (req, iss, sub, profile, cb) => {
const usrEmail = _.get(profile, '_json.email', null) || _.get(profile, '_json.preferred_username')
const emails = _.get(profile, '_json.emails', null);
const id = _.get(profile, '_json.sub', null);
const usrEmail = _.get(profile, '_json.email', null) || _.get(profile, '_json.preferred_username') || emails[0]
try {
const user = await WIKI.models.users.processProfile({
providerKey: req.params.strategy,
profile: {
id: profile.oid,
id: profile.oid || id,
displayName: profile.displayName,
email: usrEmail,
picture: ''

Loading…
Cancel
Save