Skip to content

LDAP Authentication

DArrigoni edited this page Jun 24, 2011 · 8 revisions

Example:

    use OmniAuth::Strategies::LDAP, :host => '10.101.10.1', :port => 389, :method => :plain, :base => 'dc=intridea, dc=com', :uid => 'sAMAccountName', :try_sasl => true, :sasl_mechanisms => [ "GSS-SPNEGO" ], :bind_dn => "cn=John Smith,ou=LA Office,dc=intridea,dc=com"

Options:

  • :host (required) - The LDAP server host.
  • :port (required) - The LDAP server port.
  • :method (required) - May be :plain, :ssl, or :tls.
  • :base (required) - The distinguished name (DN) for your organization; all users should be searchable under this base.
  • :uid (required) - The LDAP attribute name for the user name in the login form. Typically AD would be 'sAMAccountName' or 'UniquePersonalIdentifier', while OpenLDAP is 'uid'. You can also use 'dn' for the user to put in the dn in the login form (but usually is too long for user to remember or know).
  • :try_sasl - Try to use SASL connection to server.
  • :sasl_mechanisms - Mechanisms supported are 'DIGEST-MD5' and 'GSS-SPNEGO'
  • :bind_dn - Optional DN to use when authenticating. Default use is anonymous