fix(xo-server-auth-ldap): mark userIdAttribute as required
It can no longer be ommited since 99605bf18
This commit is contained in:
parent
035679800a
commit
2d25413b8d
@ -11,6 +11,8 @@
|
||||
|
||||
> Users must be able to say: “I had this issue, happy to know it's fixed”
|
||||
|
||||
- [LDAP] Mark the _Id attribute_ setting as required
|
||||
|
||||
### Packages to release
|
||||
|
||||
> When modifying a package, add it here with its release type.
|
||||
@ -27,4 +29,6 @@
|
||||
|
||||
<!--packages-start-->
|
||||
|
||||
- xo-server-auth-ldap patch
|
||||
|
||||
<!--packages-end-->
|
||||
|
@ -159,7 +159,7 @@ Or something like this if you also want to filter by group:
|
||||
required: ['base', 'filter', 'idAttribute', 'displayNameAttribute', 'membersMapping'],
|
||||
},
|
||||
},
|
||||
required: ['uri', 'base'],
|
||||
required: ['uri', 'base', 'userIdAttribute'],
|
||||
}
|
||||
|
||||
export const testSchema = {
|
||||
@ -290,23 +290,17 @@ class AuthLdap {
|
||||
return
|
||||
}
|
||||
|
||||
let user
|
||||
if (this._userIdAttribute === undefined) {
|
||||
// Support legacy config
|
||||
user = await this._xo.registerUser(undefined, username)
|
||||
} else {
|
||||
const ldapId = entry[this._userIdAttribute]
|
||||
user = await this._xo.registerUser2('ldap', {
|
||||
user: { id: ldapId, name: username },
|
||||
})
|
||||
const ldapId = entry[this._userIdAttribute]
|
||||
const user = await this._xo.registerUser2('ldap', {
|
||||
user: { id: ldapId, name: username },
|
||||
})
|
||||
|
||||
const groupsConfig = this._groupsConfig
|
||||
if (groupsConfig !== undefined) {
|
||||
try {
|
||||
await this._synchronizeGroups(user, entry[groupsConfig.membersMapping.userAttribute])
|
||||
} catch (error) {
|
||||
logger.error(`failed to synchronize groups: ${error.message}`)
|
||||
}
|
||||
const groupsConfig = this._groupsConfig
|
||||
if (groupsConfig !== undefined) {
|
||||
try {
|
||||
await this._synchronizeGroups(user, entry[groupsConfig.membersMapping.userAttribute])
|
||||
} catch (error) {
|
||||
logger.error(`failed to synchronize groups: ${error.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user