1
2
3
4 package org.itracker.services.authentication.adsson;
5
6 import org.apache.log4j.Logger;
7 import org.itracker.model.User;
8 import org.itracker.services.exceptions.AuthenticatorException;
9
10 import javax.security.auth.login.LoginException;
11 import java.io.IOException;
12
13
14
15
16
17
18
19 public class WindowsSSONAuthenticatorADInfo extends WindowsSSONAuthenticator {
20 private static final Logger logger = Logger.getLogger(WindowsSSONAuthenticatorADInfo.class);
21
22
23
24
25 protected User getExternalUserInfo(String login) throws AuthenticatorException {
26 try {
27
28 ADIntegrationtication/adsson/ADIntegration.html#ADIntegration">ADIntegration ad = new ADIntegration();
29 ad.login();
30
31 User userModel = (User) ad.getUserInfo(login);
32 return userModel;
33 } catch (LoginException e) {
34 logger.error("getExternalUserInfo: " + e.getMessage() + AuthenticatorException.SYSTEM_ERROR);
35 throw new AuthenticatorException("Error accessing Active Directory: " + e.getMessage(), AuthenticatorException.SYSTEM_ERROR, e);
36 } catch (IOException e) {
37 logger.error(e.getMessage());
38 throw new AuthenticatorException(e.getMessage(), AuthenticatorException.SYSTEM_ERROR);
39 }
40 }
41
42 }