Clover Coverage Report - itracker
Coverage timestamp: Tue May 1 2012 16:42:12 CEST
9   43   3   9
0   23   0.33   1
1     3  
1    
 
 
  WindowsSSONAuthenticatorADInfo       Line # 20 9 3 0% 0.0
 
No Tests
 
1    /**
2    * Originally contributed by eMation (www.emation.pt)
3    */
4    package org.itracker.services.authentication.adsson;
5   
6    import java.io.IOException;
7   
8    import javax.security.auth.login.LoginException;
9   
10    import org.apache.log4j.Logger;
11    import org.itracker.model.User;
12    import org.itracker.services.exceptions.AuthenticatorException;
13   
14    /**
15    * Extends the windows single sign on class, gets user information
16    * from active directory
17    *
18    * @author ricardo
19    */
 
20    public class WindowsSSONAuthenticatorADInfo extends WindowsSSONAuthenticator {
21    private static final Logger logger = Logger.getLogger(WindowsSSONAuthenticatorADInfo.class);
22    /**
23    *
24    * @see com.emation.itracker.authentication.WindowsSSONAuthenticator#getExternalUserInfo(java.lang.String)
25    */
 
26  0 toggle protected User getExternalUserInfo(String login) throws AuthenticatorException {
27  0 try {
28    // connect to active directory
29  0 ADIntegration ad = new ADIntegration();
30  0 ad.login();
31    // get external user info
32  0 User userModel = (User)ad.getUserInfo( login );
33  0 return userModel;
34    } catch (LoginException e) {
35  0 logger.error("getExternalUserInfo: " + e.getMessage() + AuthenticatorException.SYSTEM_ERROR );
36  0 throw new AuthenticatorException( "Error accessing Active Directory: " + e.getMessage(), AuthenticatorException.SYSTEM_ERROR, e);
37    } catch (IOException e) {
38  0 logger.error( e.getMessage() );
39  0 throw new AuthenticatorException( e.getMessage(), AuthenticatorException.SYSTEM_ERROR);
40    }
41    }
42   
43    }