From 7f3ed1652a4d802c444affd364b75f3875d82f84 Mon Sep 17 00:00:00 2001 From: Daniel Moore Date: Sun, 18 May 2014 15:50:25 -0400 Subject: [PATCH] Lowercasing all group names before assigning them as roles. Fixes #7 --- src/ldap_auth.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ldap_auth.erl b/src/ldap_auth.erl index 4db1455..1251cdd 100644 --- a/src/ldap_auth.erl +++ b/src/ldap_auth.erl @@ -246,7 +246,7 @@ authenticate_user(UserName, Password) -> {ok, UserDN} -> Groups = get_group_memberships(LdapConnection, UserDN), eldap:close(LdapConnection), - {ok, [ ?l2b(G) || G <- Groups ]} + {ok, [ ?l2b(string:to_lower(G)) || G <- Groups ]} end end. @@ -267,4 +267,4 @@ basic_name_pw(Req) -> _ -> ?LOG_INFO("Could not recognize auth header ~p", [AuthorizationHeader]), nil - end. \ No newline at end of file + end.