Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public final class BindAuthenticator

  1. Object
  2. BindAuthenticator

ImplementsLdapAuthenticator

Checks a password by binding as the user: the directory itself judges it, and its password policy (lockout, expiry) applies. The user’s name is found from DN patterns (uid={0},ou=people) or a LdapUserSearch, as in Spring.

Constructors

public BindAuthenticator(LdapContextSource contextSource)

Methods

public void setUserDnPatterns(String... patterns)Patterns relative to the base, {0} standing for the user name, tried in order.
public void setUserSearch(LdapUserSearch userSearch)
public void setUserAttributes(String... attributes)The attributes read from the user’s entry; all by default.
public LdapEntry authenticate(String username, String password)

Inherited methods

Constructor details

BindAuthenticator

public BindAuthenticator(LdapContextSource contextSource)

Method details

setUserDnPatterns

public void setUserDnPatterns(String... patterns)
Patterns relative to the base, {0} standing for the user name, tried in order.

setUserSearch

public void setUserSearch(LdapUserSearch userSearch)

setUserAttributes

public void setUserAttributes(String... attributes)
The attributes read from the user’s entry; all by default.

authenticate

public LdapEntry authenticate(String username, String password)

Throws

com.codename1.backend.security.BadCredentialsException
when the user is unknown or the password is wrong