net.liftweb.ldap

LDAPVendor

class LDAPVendor extends Loggable with SimpleInjector

This class provides functionality to allow us to search and bind (authenticate) a username from a ldap server.

To configure the LDAP Vendor parameters, use one of the configure methods to provide a Map of string parameters.

The primary parameters (with defaults) are:

-

Optionally, you can set the following parameters to control context testing and reconnect attempts:

In addition to configuration via a Map or Properties file, fine-grained control over behaviors can be specified via Inject values corresponding to each of the properties.

To use LDAPVendor, you can simply create an object extending it and configure:

object myLdap extends LDAPVendor
myLdap.configure()

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. LDAPVendor
  2. SimpleInjector
  3. Injector
  4. Loggable
  5. AnyRef
  6. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LDAPVendor()

Type Members

  1. abstract class Inject[T] extends StackableMaker[T] with Vendor[T]

    Create an object or val that is a subclass of the FactoryMaker to generate factory for a particular class as well as define session and request specific vendors and use doWith to define the vendor just for the scope of the call.

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final val DEFAULT_AUTHTYPE: java.lang.String("simple")

  7. final val DEFAULT_BASE_DN: java.lang.String("")

  8. final val DEFAULT_FACTORY: java.lang.String("com.sun.jndi.ldap.LdapCtxFactory")

  9. final val DEFAULT_LOOKUP: net.liftweb.common.Empty.type

  10. final val DEFAULT_MAX_RETRIES: Int(6)

  11. final val DEFAULT_PASSWORD: java.lang.String("")

  12. final val DEFAULT_RETRY_INTERVAL: Int(5000)

  13. final val DEFAULT_URL: java.lang.String("ldap://localhost")

  14. final val DEFAULT_USER: java.lang.String("")

  15. final val KEY_AUTHTYPE: java.lang.String("ldap.authType")

  16. final val KEY_BASE_DN: java.lang.String("ldap.base")

  17. final val KEY_FACTORY: java.lang.String("ldap.initial_context_factory")

  18. final val KEY_LOOKUP: java.lang.String("lift-ldap.testLookup")

  19. final val KEY_MAX_RETRIES: java.lang.String("lift-ldap.maxRetries")

  20. final val KEY_PASSWORD: java.lang.String("ldap.password")

  21. final val KEY_RETRY_INTERVAL: java.lang.String("lift-ldap.retryInterval")

  22. final val KEY_URL: java.lang.String("ldap.url")

  23. final val KEY_USER: java.lang.String("ldap.userName")

  24. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  25. def attributesFromDn(dn: String): Attributes

  26. def bindUser(dn: String, password: String): Boolean

    Attempts to authenticate the given DN against the configured LDAP provider.

  27. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  28. def configuration: Map[String, String]

    The configuration to use for connecting to the provider.

    The configuration to use for connecting to the provider. It should be set via the configure methods

  29. def configure(props: Map[String, String]): Unit

    Configure from the given Map[String,String]

  30. def configure(stream: InputStream): Unit

    Configure from the given input stream.

    Configure from the given input stream. The stream is expected to be in a format parseable by java.util.Properties

  31. def configure(filename: String): Unit

    Configure from the given file.

    Configure from the given file. The file is expected to be in a format parseable by java.util.Properties

  32. def configure(): Unit

    Configure straight from the Props object.

    Configure straight from the Props object. This allows you to use Lift's run modes for different LDAP configuration.

  33. def defaultSearchControls(): SearchControls

    The default SearchControls to use: search the base DN with a sub-tree scope, and return the "cn" attribute.

  34. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  35. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  36. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  37. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  38. def getInitialContext(): InitialLdapContext

    This method attempts to fetch the cached InitialLdapContext for the current thread.

    This method attempts to fetch the cached InitialLdapContext for the current thread. If there isn't a current context, open a new one. If a test DN is configured, the connection (cached or new) will be validated by performing a lookup on the test DN.

    Attributes
    protected
  39. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  40. def initialContext: InitialLdapContext

    Obtains a (possibly cached) InitialContext instance based on the currently set parameters.

  41. implicit def inject[T](implicit man: Manifest[T]): Box[T]

    Perform the injection for the given type.

    Perform the injection for the given type. You can call: inject[Date] or inject[List[Map[String, PaymentThing]]]. The appropriate Manifest will be

    Definition Classes
    SimpleInjectorInjector
  42. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  43. val ldapAuthType: Inject[String]

    This controls the type of authentication to use.

  44. val ldapBaseDn: Inject[String]

    This controls the base DN used for searcheds

  45. val ldapFactory: Inject[String]

    This controls the factory used to obtain an InitialContext

  46. val ldapPassword: Inject[String]

    This controls the password used to bind for searches (not authentication)

  47. val ldapUrl: Inject[String]

    This controls the URL used to connect to the LDAP server

  48. val ldapUser: Inject[String]

    This controls the username used to bind for searches (not authentication)

  49. val logger: Logger

    Attributes
    protected
    Definition Classes
    Loggable
  50. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  51. final def notify(): Unit

    Definition Classes
    AnyRef
  52. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  53. def openInitialContext(): InitialLdapContext

    This method does the actual work of setting up the environment and constructing the InitialLdapContext.

    This method does the actual work of setting up the environment and constructing the InitialLdapContext.

    Attributes
    protected
  54. def processConfig(input: Map[String, String]): Map[String, String]

    This method checks the configuration and sets defaults for any properties that are required.

    This method checks the configuration and sets defaults for any properties that are required. It also processes any of the optional configuration propertes related to context testing and retries.

    This method is intended to be called during update of the default configuration, not during granular override of the config.

  55. def propertiesToMap(props: Properties): Map[String, String]

    Attributes
    protected
  56. def registerInjection[T](f: () ⇒ T)(implicit man: Manifest[T]): Unit

    Register a function that will inject for the given Manifest

    Register a function that will inject for the given Manifest

    Definition Classes
    SimpleInjector
  57. val retryInterval: Inject[Long]

    This sets the interval between connection attempts on the InitialContext.

    This sets the interval between connection attempts on the InitialContext. The default is 5 seconds

  58. val retryMaxCount: Inject[Int]

    This sets the maximum number of connection attempts before giving up.

    This sets the maximum number of connection attempts before giving up. The default is 6

  59. def search(filter: String): List[String]

    Searches the base DN for entities matching the given filter.

  60. val searchControls: Inject[SearchControls]

    This sets the Directory SearchControls instance that is used to refine searches on the provider.

  61. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  62. val testLookup: Inject[Box[String]]

    This can be set to test the InitialContext on each LDAP operation.

    This can be set to test the InitialContext on each LDAP operation. It should be set to a search DN.

  63. def toString(): String

    Definition Classes
    AnyRef → Any
  64. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  65. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  66. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from SimpleInjector

Inherited from Injector

Inherited from Loggable

Inherited from AnyRef

Inherited from Any