Package org.h2.security.auth.impl

# Class LdapCredentialsValidator

java.lang.Object
org.h2.security.auth.impl.LdapCredentialsValidator

All Implemented Interfaces:
  `CredentialsValidator`, `Configurable`

public class LdapCredentialsValidator extends Object implements CredentialsValidator
Validate credentials by performing an LDAP bind

Configuration parameters:

- bindDnPattern bind dn pattern with %u instead of username (example: uid=%u,ou=users,dc=example,dc=com)
- host ldap server
- port of ldap service; optional, by default 389 for insecure, 636 for secure
- secure, optional by default is true (use SSL)

## Constructor Summary

Constructors
Constructor
Description
`LdapCredentialsValidator()`

## Method Summary

Modifier and Type
Method
Description
`void`
`configure(ConfigProperties configProperties)`
configure the component
`boolean`
`validateCredentials(AuthenticationInfo authenticationInfo)`
Validate user credential.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### LdapCredentialsValidator

public LdapCredentialsValidator()

## Method Details

### configure

public void configure(ConfigProperties configProperties)
Description copied from interface: `Configurable`
configure the component

Specified by:
  `configure` in interface `Configurable`
Parameters:
  `configProperties` - = configuration properties

### validateCredentials

public boolean validateCredentials(AuthenticationInfo authenticationInfo) throws Exception
Description copied from interface: `CredentialsValidator`
Validate user credential.

Specified by:
  `validateCredentials` in interface `CredentialsValidator`
Parameters:
  `authenticationInfo` - = authentication info
Returns:
  true if credentials are valid, otherwise false
Throws:
  `Exception` - any exception occurred (invalid credentials or internal issue) prevent user login