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
Known Subclasses
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. 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. def != (arg0: AnyRef): Boolean

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

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

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

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

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

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

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

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

    Attributes
    final
  10. val DEFAULT_MAX_RETRIES : Int(6)

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

    Attributes
    final
  12. val DEFAULT_RETRY_INTERVAL : Int(5000)

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

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

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

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

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

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

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

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

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

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

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

    Attributes
    final
  24. def asInstanceOf [T0] : T0

    Attributes
    final
    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. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    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. def getClass (): java.lang.Class[_]

    Attributes
    final
    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

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

    Attributes
    final
    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. def ne (arg0: AnyRef): Boolean

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

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

    Attributes
    final
    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. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    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. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Deprecated Value Members

  1. def parameters : () ⇒ Map[String, String]

    Annotations
    @deprecated
    Deprecated

    Use the configure(...) methods

  2. def parameters_= (newParams: () ⇒ Map[String, String]): Unit

    Annotations
    @deprecated
    Deprecated

    Use the configure(...) methods

Inherited from SimpleInjector

Inherited from Injector

Inherited from Loggable

Inherited from AnyRef

Inherited from Any