|
|
@@ -220,7 +220,12 @@ class PassportService {
|
|
|
bindDN.replace(/{{username}}/, loginForm.username):
|
|
|
bindDN;
|
|
|
const fixedBindCredentials = (isUserBind) ? loginForm.password : bindCredentials;
|
|
|
- let serverOpt = { url, bindDN: fixedBindDN, bindCredentials: fixedBindCredentials, searchBase, searchFilter };
|
|
|
+ let serverOpt = {
|
|
|
+ url, bindDN: fixedBindDN, bindCredentials: fixedBindCredentials,
|
|
|
+ searchBase, searchFilter,
|
|
|
+ attrMapUsername: this.getLdapAttrNameMappedToUsername(),
|
|
|
+ attrMapName: this.getLdapAttrNameMappedToName(),
|
|
|
+ };
|
|
|
|
|
|
if (groupSearchBase && groupSearchFilter) {
|
|
|
serverOpt = Object.assign(serverOpt, { groupSearchBase, groupSearchFilter, groupDnProperty });
|
|
|
@@ -265,9 +270,9 @@ class PassportService {
|
|
|
|
|
|
debug('GoogleStrategy: setting up..');
|
|
|
passport.use(new GoogleStrategy({
|
|
|
- clientId: config.crowi['security:passport-google:clientId'] || process.env.OAUTH_GOOGLE_CLIENT_SECRET,
|
|
|
+ clientId: config.crowi['security:passport-google:clientId'] || process.env.OAUTH_GOOGLE_CLIENT_ID,
|
|
|
clientSecret: config.crowi['security:passport-google:clientSecret'] || process.env.OAUTH_GOOGLE_CLIENT_SECRET,
|
|
|
- callbackURL: 'http://localhost:3000/passport/google/callback', //change this
|
|
|
+ callbackURL: config.crowi['security:passport-google:callbackUrl'] || process.env.OAUTH_GOOGLE_CALLBACK_URI,
|
|
|
skipUserProfile: false,
|
|
|
}, function(accessToken, refreshToken, profile, done) {
|
|
|
if (profile) {
|
|
|
@@ -313,7 +318,7 @@ class PassportService {
|
|
|
passport.use(new GitHubStrategy({
|
|
|
clientID: config.crowi['security:passport-github:clientId'] || process.env.OAUTH_GITHUB_CLIENT_ID,
|
|
|
clientSecret: config.crowi['security:passport-github:clientSecret'] || process.env.OAUTH_GITHUB_CLIENT_SECRET,
|
|
|
- callbackURL: 'http://localhost:3000/passport/github/callback', //change this
|
|
|
+ callbackURL: config.crowi['security:passport-github:callbackUrl'] || process.env.OAUTH_GITHUB_CALLBACK_URI,
|
|
|
skipUserProfile: false,
|
|
|
}, function(accessToken, refreshToken, profile, done) {
|
|
|
if (profile) {
|