Disallow LDAP bind if trap is set; support setting trap from user form

This commit is contained in:
garrettmills
2020-05-22 09:47:01 -05:00
parent 64356d42d0
commit decb83bdbb
9 changed files with 77 additions and 4 deletions

View File

@@ -90,6 +90,11 @@ class LDAPController extends Injectable {
return next(new LDAP.InvalidCredentialsError())
}
// Check if the resource has a trap. If so, deny access.
if ( item.trap ) {
return next(new LDAP.InvalidCredentialsError('This resource currently has a login trap set. Please visit the web UI to release.'))
}
this.output.info(`Successfully bound resource as DN: ${req.dn.format(this.configs.get('ldap:server.format'))}.`)
res.end()
return next()