Skip to content

Commit

Permalink
ldap username email suffix
Browse files Browse the repository at this point in the history
allow empty
  • Loading branch information
carlosfu committed Jun 20, 2016
1 parent a7a7ac6 commit da437aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ public class ConstUtils {
public static String DEFAULT_LDAP_URL = NONE;
public static String LDAP_URL = DEFAULT_LDAP_URL;

/**
* 登陆邮箱后缀
*/
public static String EMAIL_SUFFIX = "";

/**
* 是否为调试
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static boolean passportCheck(String username, String password) {
env.put("java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory");
env.put("java.naming.provider.url", ldapUrl);
env.put("java.naming.security.authentication", "simple");
env.put("java.naming.security.principal", username);
env.put("java.naming.security.principal", username + ConstUtils.EMAIL_SUFFIX);
env.put("java.naming.security.credentials", password);
DirContext ctx = null;
try {
Expand Down

0 comments on commit da437aa

Please sign in to comment.