mirror of
https://git.unistra.fr/aius/root/ldap-overleaf-sl.git
synced 2025-05-04 19:55:26 +02:00
Some minor update
This commit is contained in:
parent
26b1aca34b
commit
13b76926ca
3 changed files with 23 additions and 8 deletions
|
@ -34,6 +34,12 @@ db.users.find({email:"EMAIL"}).pretty()
|
||||||
db.users.update({email : OLDEMAIL},{$set: { email : NEWEMAIL}});
|
db.users.update({email : OLDEMAIL},{$set: { email : NEWEMAIL}});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Coming soon
|
||||||
|
|
||||||
|
- Option that Admins can invite non LDAP User
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
### Domain Configuration
|
### Domain Configuration
|
||||||
|
|
|
@ -48,6 +48,9 @@ services:
|
||||||
LDAP_BINDDN: ou=someunit,ou=people,dc=DOMAIN,dc=TLS
|
LDAP_BINDDN: ou=someunit,ou=people,dc=DOMAIN,dc=TLS
|
||||||
# By default tries to bind directly with the ldap user - this user has to be in the LDAP GROUP
|
# By default tries to bind directly with the ldap user - this user has to be in the LDAP GROUP
|
||||||
LDAP_GROUP_FILTER: '(memberof=cn=GROUPNAME,ou=groups,dc=DOMAIN,dc=TLD)'
|
LDAP_GROUP_FILTER: '(memberof=cn=GROUPNAME,ou=groups,dc=DOMAIN,dc=TLD)'
|
||||||
|
#LDAP_GROUP_FILTER: '(memberof=GROUPNAME,ou=groups,dc=DOMAIN,dc=TLD)'
|
||||||
|
# if user is in ADMIN_GROUP on user creation (first login) isAdmin is set to true.
|
||||||
|
#LDAP_ADMIN_GROUP_FILTER: '(memberof=cn=ADMINGROUPNAME,ou=groups,dc=DOMAIN,dc=TLD)'
|
||||||
LDAP_CONTACTS: 'false'
|
LDAP_CONTACTS: 'false'
|
||||||
|
|
||||||
# Same property, unfortunately with different names in
|
# Same property, unfortunately with different names in
|
||||||
|
|
|
@ -59,7 +59,6 @@ const AuthenticationManager = {
|
||||||
let pass = require("crypto").randomBytes(32).toString("hex")
|
let pass = require("crypto").randomBytes(32).toString("hex")
|
||||||
const userRegHand = require('../User/UserRegistrationHandler.js')
|
const userRegHand = require('../User/UserRegistrationHandler.js')
|
||||||
userRegHand.registerNewUser({
|
userRegHand.registerNewUser({
|
||||||
//_id: uid,
|
|
||||||
email: mail,
|
email: mail,
|
||||||
first_name: firstname,
|
first_name: firstname,
|
||||||
last_name: lastname,
|
last_name: lastname,
|
||||||
|
@ -70,11 +69,7 @@ const AuthenticationManager = {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
}
|
}
|
||||||
user.email = mail
|
user.email = mail
|
||||||
if (isAdmin) {
|
user.isAdmin = isAdmin
|
||||||
user.admin = true
|
|
||||||
} else {
|
|
||||||
user.admin = false
|
|
||||||
}
|
|
||||||
user.emails[0].confirmedAt = Date.now()
|
user.emails[0].confirmedAt = Date.now()
|
||||||
user.save()
|
user.save()
|
||||||
//console.log("user %s added to local library: ", mail)
|
//console.log("user %s added to local library: ", mail)
|
||||||
|
@ -93,8 +88,19 @@ const AuthenticationManager = {
|
||||||
},
|
},
|
||||||
|
|
||||||
authUserObj(error, user, query, password, callback) {
|
authUserObj(error, user, query, password, callback) {
|
||||||
// check if user is in ldap and logon if the ldapuser exists.
|
// check if user is in ldap and logon if the ldapuser exists
|
||||||
AuthenticationManager.ldapAuth(query, password, AuthenticationManager.createIfNotExistAndLogin, callback, user)
|
// external email login
|
||||||
|
if (user && user.hashedPassword) {
|
||||||
|
console.log("email login for existing user")
|
||||||
|
bcrypt.compare(password, user.hashedPassword, function (error, match) {
|
||||||
|
if (match) {
|
||||||
|
console.log("Fine")
|
||||||
|
AuthenticationManager.login(user, password, callback)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
AuthenticationManager.ldapAuth(query, password, AuthenticationManager.createIfNotExistAndLogin, callback, user)
|
||||||
|
}
|
||||||
return null
|
return null
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue