Modified profile fields mapping
This commit is contained in:
parent
bd8289828a
commit
d544a00762
1 changed files with 16 additions and 10 deletions
26
library.js
26
library.js
|
|
@ -29,19 +29,25 @@
|
||||||
path: meta.config['sso:saml:callbackpath'],
|
path: meta.config['sso:saml:callbackpath'],
|
||||||
entryPoint: meta.config['sso:saml:idpentrypoint'],
|
entryPoint: meta.config['sso:saml:idpentrypoint'],
|
||||||
issuer: meta.config['sso:saml:issuer'],
|
issuer: meta.config['sso:saml:issuer'],
|
||||||
callbackUrl: nconf.get('url') + meta.config['sso:saml:callbackpath']
|
callbackUrl: nconf.get('url') + meta.config['sso:saml:callbackpath'],
|
||||||
|
disableRequestedAuthnContext: true,
|
||||||
|
identifierFormat: null
|
||||||
},
|
},
|
||||||
function(profile, done) {
|
function(profile, done) {
|
||||||
|
console.log(profile);
|
||||||
var user = {
|
var user = {
|
||||||
nameID: profile.nameID,
|
nameID: profile.nameID,
|
||||||
nameIDFormat: profile.nameIDFormat,
|
nameIDFormat: profile.nameIDFormat,
|
||||||
sn: profile.sn,
|
sn: profile['urn:oid:2.5.4.4'], // sn
|
||||||
cn: profile.cn,
|
//sn: profile.sn,
|
||||||
mail: profile.mail,
|
cn: profile['urn:oid:2.5.4.42'], // givenname
|
||||||
eduPersonAffiliation: profile.eduPersonAffiliation,
|
//cn: profile.cn,
|
||||||
email: profile.email,
|
//mail: profile.mail,
|
||||||
username: profile.eduPersonNickname
|
//eduPersonAffiliation: profile.eduPersonAffiliation,
|
||||||
|
email: profile.mail,
|
||||||
|
//email: profile.email,
|
||||||
|
username: profile['urn:oid:1.3.6.1.4.1.5923.1.1.1.2'] // eduPersonNickname
|
||||||
|
//username: profile.eduPersonNickname
|
||||||
};
|
};
|
||||||
|
|
||||||
SAML.login(user,function(err, user) {
|
SAML.login(user,function(err, user) {
|
||||||
|
|
@ -156,12 +162,12 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
console.log(userdata);
|
||||||
// New User
|
// New User
|
||||||
user.create({
|
user.create({
|
||||||
username: userdata.username,
|
username: userdata.username,
|
||||||
email: userdata.email,
|
email: userdata.email,
|
||||||
fullname : userdata.cn + " " + userdata.sn
|
fullname : userdata.first_name + " " + userdata.last_name
|
||||||
|
|
||||||
}, function(err, uid) {
|
}, function(err, uid) {
|
||||||
if(err) {
|
if(err) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue