Moved 'server', 'port' and 'tls' from the list of mandatory parameters to the list of additional ones, as they aren't required when using an URI instead.
Added 'uri' to the list of additional parameters.
Drop 'server' from the default opts, as 'server' should only be set when using it to override the usage of 'uri'.
Corrected description of __init__, added 'uri' to it's params.
Only initialize the LDAP object when 'server' is explicitely set, otherwise default to use the 'uri'.
Use self.uri instead of uri for ldap.initialize. Display different error messages for the LDAP initialization/initial bind depending on the used params.
Removed dead code.
Removed dead code.
Use **kwargs instead of a fixed list of arguments.
Determine self.uri based on the existence of kwargs['server'], so only when 'server' is provided, the URI is determined based upon schema/host/port, otherwise the provided URI and as fallback the default URI from config will be used.
Removed dead code.
Hide the bindpw in the log output for failing logins.
Assign binddn/bindpw properly.
Refactored __init__() and auth() by moving as much of the logic/arg handling into __init__. Needs further testing to make sure all possible configuration scenarios are properly supported.