| | |
| | | String loggingInUserDN = loggingInUser.getDN();
|
| | |
|
| | | if (isAuthenticated(ldapConnection, loggingInUserDN, new String(password))) {
|
| | | logger.debug("Authenitcated: " + username);
|
| | | logger.debug("LDAP authenticated: " + username);
|
| | |
|
| | | UserModel user = getUserModel(simpleUsername);
|
| | | if (user == null) // create user object for new authenticated user
|
| | |
| | |
|
| | | private TeamModel createTeamFromLdap(SearchResultEntry teamEntry) {
|
| | | TeamModel answer = new TeamModel(teamEntry.getAttributeValue("cn"));
|
| | | // If attributes other than team name ever from from LDAP, this is where to get them
|
| | | // potentially retrieve other attributes here in the future
|
| | |
|
| | | return answer;
|
| | | }
|
| | |
|
| | | private UserModel createUserFromLdap(String simpleUserName, SearchResultEntry userEntry) {
|
| | | UserModel answer = new UserModel(simpleUserName);
|
| | | //If attributes other than user name ever from from LDAP, this is where to get them
|
| | | // potentially retrieve other attributes here in the future
|
| | |
|
| | | return answer;
|
| | | }
|
| | |
| | | ldapConnection.bind(userDn, password);
|
| | | return true;
|
| | | } catch (LDAPException e) {
|
| | | logger.error("Error authenitcating user", e);
|
| | | logger.error("Error authenticating user", e);
|
| | | return false;
|
| | | }
|
| | | }
|