Browse Source

Lowercasing all group names before assigning them as roles. Fixes #7

Daniel Moore 11 years ago
parent
commit
7f3ed1652a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/ldap_auth.erl

+ 2 - 2
src/ldap_auth.erl

@@ -246,7 +246,7 @@ authenticate_user(UserName, Password) ->
         {ok, UserDN} ->
         {ok, UserDN} ->
           Groups = get_group_memberships(LdapConnection, UserDN),
           Groups = get_group_memberships(LdapConnection, UserDN),
           eldap:close(LdapConnection),
           eldap:close(LdapConnection),
-          {ok, [ ?l2b(G) || G <- Groups ]}
+          {ok, [ ?l2b(string:to_lower(G)) || G <- Groups ]}
       end
       end
   end.
   end.
 
 
@@ -267,4 +267,4 @@ basic_name_pw(Req) ->
     _ ->
     _ ->
       ?LOG_INFO("Could not recognize auth header ~p", [AuthorizationHeader]),
       ?LOG_INFO("Could not recognize auth header ~p", [AuthorizationHeader]),
       nil
       nil
-  end.
+  end.