check for required config options
This commit is contained in:
parent
070c51a006
commit
7828b952be
1 changed files with 34 additions and 32 deletions
66
library.js
66
library.js
|
|
@ -38,39 +38,41 @@
|
||||||
master_config = options;
|
master_config = options;
|
||||||
});
|
});
|
||||||
|
|
||||||
samlObj = new passportSAML({
|
if (master_config.idp_entry_point && master_config.callback_path && master_config.issuer && master_config.metadata) {
|
||||||
path: master_config.callback_path,
|
samlObj = new passportSAML({
|
||||||
entryPoint: master_config.idp_entry_point,
|
path: master_config.callback_path,
|
||||||
issuer: master_config.issuer,
|
entryPoint: master_config.idp_entry_point,
|
||||||
callbackUrl: nconf.get('url') + master_config.callback_path,
|
issuer: master_config.issuer,
|
||||||
disableRequestedAuthnContext: true,
|
callbackUrl: nconf.get('url') + master_config.callback_path,
|
||||||
identifierFormat: null
|
disableRequestedAuthnContext: true,
|
||||||
},
|
identifierFormat: null
|
||||||
function(profile, done) {
|
},
|
||||||
console.log("[sso-saml] profile, ", profile);
|
function(profile, done) {
|
||||||
var user = {
|
console.log("[sso-saml] profile, ", profile);
|
||||||
nameID: profile.nameID,
|
var user = {
|
||||||
nameIDFormat: profile.nameIDFormat,
|
nameID: profile.nameID,
|
||||||
sn: profile['urn:oid:2.5.4.4'], // sn
|
nameIDFormat: profile.nameIDFormat,
|
||||||
//sn: profile.sn,
|
sn: profile['urn:oid:2.5.4.4'], // sn
|
||||||
cn: profile['urn:oid:2.5.4.42'], // givenname
|
//sn: profile.sn,
|
||||||
//cn: profile.cn,
|
cn: profile['urn:oid:2.5.4.42'], // givenname
|
||||||
//mail: profile.mail,
|
//cn: profile.cn,
|
||||||
//eduPersonAffiliation: profile.eduPersonAffiliation,
|
//mail: profile.mail,
|
||||||
email: profile.mail,
|
//eduPersonAffiliation: profile.eduPersonAffiliation,
|
||||||
//email: profile.email,
|
email: profile.mail,
|
||||||
username: profile['urn:oid:1.3.6.1.4.1.5923.1.1.1.2'], // eduPersonNickname
|
//email: profile.email,
|
||||||
//username: profile.eduPersonNickname
|
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) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return done(err);
|
return done(err);
|
||||||
}
|
}
|
||||||
done(null, user);
|
done(null, user);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
console.log("[sso-saml] samlObj", samlObj);
|
console.log("[sso-saml] samlObj", samlObj);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue