parent
cdf1a5fe47
commit
47991b7d1a
@ -106,6 +106,21 @@ For Microsoft Active Directory, you can try one of the following filters:
|
||||
required: ['uri', 'base']
|
||||
}
|
||||
|
||||
export const testSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
username: {
|
||||
description: 'LDAP username',
|
||||
type: 'string'
|
||||
},
|
||||
password: {
|
||||
description: 'LDAP password',
|
||||
type: 'string'
|
||||
}
|
||||
},
|
||||
required: ['username', 'password']
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
|
||||
class AuthLdap {
|
||||
@ -163,6 +178,13 @@ class AuthLdap {
|
||||
this._xo.unregisterAuthenticationProvider(this._authenticate)
|
||||
}
|
||||
|
||||
test ({ username, password }) {
|
||||
return this._authenticate({
|
||||
username,
|
||||
password
|
||||
})
|
||||
}
|
||||
|
||||
async _authenticate ({ username, password }, logger = noop) {
|
||||
if (username === undefined || password === undefined) {
|
||||
logger('require `username` and `password` to authenticate!')
|
||||
|
Loading…
Reference in New Issue
Block a user