Package com.codename1.backend.security.ldap


package com.codename1.backend.security.ldap
Signing users in against an LDAP directory or Active Directory, the way Spring Security's LDAP module does: LdapAuthenticationProvider with a BindAuthenticator and a DefaultLdapAuthoritiesPopulator, or ActiveDirectoryLdapAuthenticationProvider. The client underneath, LdapConnection, speaks LDAPv3 itself over the backend's sockets: simple bind, search, StartTLS and ldaps://. Not supported: SASL binds, following referrals, connection pooling and writing to the directory.
  • Class
    Description
    Signs users in against Active Directory, as Spring's provider of the same name: binds as user@domain, reads the user's entry by userPrincipalName, and makes each group in memberOf an authority named by the group's CN (Domain Admins, no prefix).
    Checks a password by binding as the user: the directory itself judges it, and its password policy (lockout, expiry) applies.
    Roles from the groups a user is a member of, as Spring's: the groups under a search base whose member names the user, each group's cn becoming ROLE_ and its name in upper case.
    Finds a user by a filter under a search base, with the user name in place of {0} -- escaped, so a name of * or x)(uid=* matches only itself.
    Signs users in against an LDAP directory, for form login and HTTP Basic alike: an LdapAuthenticator checks the password, an LdapAuthoritiesPopulator answers the roles.
    Checks a user's password against the directory and answers their entry.
    The roles of a user the directory signed in.
    One LDAPv3 session (RFC 4511) on one socket: simple bind, search, StartTLS and unbind -- what signing users in against a directory needs, and no more.
    Where the directory is and how to reach it: the server URLs, tried in order, the base every name is under, the account searches run as, and the TLS settings.
    Escaping for what a user types that ends up inside a filter or a distinguished name.
    One entry a search found: its distinguished name and the attributes asked for.
    An LDAP operation the directory refused, with its result code (RFC 4511 section 4.1.9) and the server's diagnostic message.
    The principal of a directory sign-in: the user name, the entry's DN, the entry itself and the roles.
    Finds the directory entry of the user signing in.