@Test public void testComplexEmail() { Map<String, Object> settings = getSettings(); settings.put("emailMapping", "${givenName}.${surname}@gitblit.com"); ldap = newRealm(settings); Account userOne = ldap.authenticate("UserOne", "userOnePassword"); assertNotNull(userOne); assertTrue(userOne.getEmailAddresses().contains("User.One@gitblit.com")); }
@Override public Account authenticate(StandardCredentials requestCredentials) { final String username = getSimpleUsername(requestCredentials.getUsername()); final String password = requestCredentials.getPassword(); if (hasAccount(username)) { return super.authenticate(new StandardCredentials(username, password)); } return authenticate(username, password); }
LdapRealm extends CachingRealm { @Override public Account authenticate(StandardCredentials requestCredentials) { final String username = getSimpleUsername(requestCredentials.getUsername()); final String password = requestCredentials.getPassword(); if (hasAccount(username)) { return super.authenticate(new StandardCredentials(username, password)); } return authenticate(username, password); } }
LdapRealm extends CachingRealm { @Override public Account authenticate(StandardCredentials requestCredentials) { final String username = getSimpleUsername(requestCredentials.getUsername()); final String password = requestCredentials.getPassword(); if (hasAccount(username)) { return super.authenticate(new StandardCredentials(username, password)); } return authenticate(username, password); }  }
LdapRealm extends CachingRealm { @Override public Account authenticate(StandardCredentials requestCredentials) { final String username = getSimpleUsername(requestCredentials.getUsername()); final String password = requestCredentials.getPassword(); if (hasAccount(username)) { return super.authenticate(new StandardCredentials(username, password)); } return authenticate(username, password); }  static final String escapeLDAPSearchFilter(String filter); @Override void setup(Config config); @Override void start(); @Override void stop(); @Override Account authenticate(StandardCredentials requestCredentials); @Override Account authenticate(final String username, final String password); }
LdapRealm extends CachingRealm { @Override public Account authenticate(StandardCredentials requestCredentials) { final String username = getSimpleUsername(requestCredentials.getUsername()); final String password = requestCredentials.getPassword(); if (hasAccount(username)) { return super.authenticate(new StandardCredentials(username, password)); } return authenticate(username, password); }  static final String escapeLDAPSearchFilter(String filter); @Override void setup(Config config); @Override void start(); @Override void stop(); @Override Account authenticate(StandardCredentials requestCredentials); @Override Account authenticate(final String username, final String password);  }