Manuel
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
3 additions and
2 deletions
-
server/core/auth.js
-
server/models/users.js
-
server/modules/authentication/ldap/authentication.js
|
@ -82,6 +82,7 @@ module.exports = { |
|
|
const strategy = require(`../modules/authentication/${stg.strategyKey}/authentication.js`) |
|
|
const strategy = require(`../modules/authentication/${stg.strategyKey}/authentication.js`) |
|
|
|
|
|
|
|
|
stg.config.callbackURL = `${WIKI.config.host}/login/${stg.key}/callback` |
|
|
stg.config.callbackURL = `${WIKI.config.host}/login/${stg.key}/callback` |
|
|
|
|
|
stg.config.key = stg.key; |
|
|
strategy.init(passport, stg.config) |
|
|
strategy.init(passport, stg.config) |
|
|
strategy.config = stg.config |
|
|
strategy.config = stg.config |
|
|
|
|
|
|
|
|
|
@ -308,7 +308,7 @@ module.exports = class User extends Model { |
|
|
|
|
|
|
|
|
// Authenticate
|
|
|
// Authenticate
|
|
|
return new Promise((resolve, reject) => { |
|
|
return new Promise((resolve, reject) => { |
|
|
WIKI.auth.passport.authenticate(selStrategy.strategyKey, { |
|
|
|
|
|
|
|
|
WIKI.auth.passport.authenticate(selStrategy.key, { |
|
|
session: !strInfo.useForm, |
|
|
session: !strInfo.useForm, |
|
|
scope: strInfo.scopes ? strInfo.scopes : null |
|
|
scope: strInfo.scopes ? strInfo.scopes : null |
|
|
}, async (err, user, info) => { |
|
|
}, async (err, user, info) => { |
|
|
|
@ -10,7 +10,7 @@ const _ = require('lodash') |
|
|
|
|
|
|
|
|
module.exports = { |
|
|
module.exports = { |
|
|
init (passport, conf) { |
|
|
init (passport, conf) { |
|
|
passport.use('ldap', |
|
|
|
|
|
|
|
|
passport.use(conf.key, |
|
|
new LdapStrategy({ |
|
|
new LdapStrategy({ |
|
|
server: { |
|
|
server: { |
|
|
url: conf.url, |
|
|
url: conf.url, |
|
|