Add option to enable anonymous authentication

This will allow the user to enable the anon_auth flag in eldap in order
to be able to do a dn lookup by using anonymous authentication instead
of using a dedicated bind user.
This commit is contained in:
William Tan 2017-05-10 17:05:01 +00:00
parent 6bfa455084
commit e8a79c06bd
2 changed files with 3 additions and 1 deletions

View File

@ -11,6 +11,7 @@ define PROJECT_ENV
{group_lookup_base, none},
{dn_lookup_bind, as_user},
{other_bind, as_user},
{anon_auth, false},
{vhost_access_query, {constant, true}},
{resource_access_query, {constant, true}},
{tag_queries, [{administrator, {constant, false}}]},

View File

@ -389,7 +389,8 @@ with_ldap({error, _} = E, _Fun, _State) ->
%% of interest, so this could still be more efficient.
with_ldap({ok, Creds}, Fun, Servers) ->
Opts0 = [{port, env(port)},
{idle_timeout, env(idle_timeout)}],
{idle_timeout, env(idle_timeout)},
{anon_auth, env(anon_auth)}],
Opts1 = case env(log) of
network ->
Pre = " LDAP network traffic: ",