From d544a007627e24357dda820e63b0b66ef48ff549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Yeguas?= Date: Tue, 9 Dec 2014 12:22:19 +0000 Subject: [PATCH] Modified profile fields mapping --- library.js | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/library.js b/library.js index d117f14..12c9cfa 100644 --- a/library.js +++ b/library.js @@ -29,19 +29,25 @@ path: meta.config['sso:saml:callbackpath'], entryPoint: meta.config['sso:saml:idpentrypoint'], 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) { - + console.log(profile); var user = { nameID: profile.nameID, nameIDFormat: profile.nameIDFormat, - sn: profile.sn, - cn: profile.cn, - mail: profile.mail, - eduPersonAffiliation: profile.eduPersonAffiliation, - email: profile.email, - username: profile.eduPersonNickname + sn: profile['urn:oid:2.5.4.4'], // sn + //sn: profile.sn, + cn: profile['urn:oid:2.5.4.42'], // givenname + //cn: profile.cn, + //mail: profile.mail, + //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) { @@ -156,12 +162,12 @@ }); } else { - + console.log(userdata); // New User user.create({ username: userdata.username, email: userdata.email, - fullname : userdata.cn + " " + userdata.sn + fullname : userdata.first_name + " " + userdata.last_name }, function(err, uid) { if(err) {