Topic on Project:Support desk

How to configure authentication with LDAPS?

5
Laujc (talkcontribs)

I have installed and configured LDAPAuthentication2, LDAPProvider, and PluggableAuth extensions for authentication via our domain. I can login with using port 389 but when using the secure port 636, it failed every time. In the ldap.log,it keeps showing: ldap_connect( $hostname = 'ldap://mysite.com:636', $port = 389


I'm not sure where that "$port=389" comes from in this log. In my localsettings.php, I specifically set the port to 636. The error said, "returns Can't contact LDAP server". I assumed either the port or server is wrong. I'm not sure what other settings need to be looked at. Any help is much appreciated.

Bawolff (talkcontribs)

I don't know much about ldap, but if using the secure port, you probably need ldaps://mysite.com:636 (The S in the protocol means secure). The second port 389, is an old mechanism in php, which should be overriden by the port in the url, so i think the log is confusing, but does not mean its actually using that port.

Laujc (talkcontribs)

How do I specify the "s" in the protocol? This is my php array configuration.

$LDAPProviderDomainConfigProvider = function() {

$config = [

'myDomain.com' => [

'connection' => [

"server" => "ldap.myDomain.com",

"port" => 636,

"user" => "cn=LDAPMediaWiki,ou=ldap,ou=other,ou=myDomain users,dc=myDomain,dc=com",

"pass" => "password",

"enctype" => "tls",

"options" => [

"LDAP_OPT_DEREF" => 1

],

"basedn" => "dc=myDomain,dc=com",

"groupbasedn" => "ou=myDomain groups,dc=myDomain,dc=com",

"userbasedn" => "ou=myDomain users,dc=myDomain,dc=com",

"searchattribute" => "samaccountname",

"usernameattribute" => "samaccountname",

"realnameattribute" => "displayname",

"emailattribute" => "mail",

"grouprequest" => "MediaWiki\\Extension\\LDAPProvider\\UserGroupsRequest\\UserMemberOf::factory"

],

]

];

return new \MediaWiki\Extension\LDAPProvider\DomainConfigProvider\InlinePHPArray( $config );

};

Laujc (talkcontribs)

Does anyone has any suggestion?

Laujc (talkcontribs)

I still keep getting this error. Did anyone got secure port to work on their environment? Thanks!

Reply to "How to configure authentication with LDAPS?"