@Test public void testDisabled() throws Exception { configuration.setClientSecurityType(ClientSecurityType.LOCAL); Authentication authentication = new UsernamePasswordAuthenticationToken("allowedUser", "password"); Authentication auth = authenticationProvider.authenticate(authentication); Assert.assertTrue(auth == null); }
@Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { if(isPamEnabled()){ PAM pam; try{ String pamConfig = configuration.getPamConfigurationFile(); pam = new PAM(pamConfig); } catch(PAMException ex) { LOG.error("Unable to Initialize PAM." + ex.getMessage()); throw new AuthenticationServiceException("Unable to Initialize PAM - ", ex); } return authenticateViaPam(pam, authentication); } else { return null; } }
AmbariPamAuthenticationProvider implements AuthenticationProvider { @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { if(isPamEnabled()){ PAM pam; try{ String pamConfig = configuration.getPamConfigurationFile(); pam = new PAM(pamConfig); } catch(PAMException ex) { LOG.error("Unable to Initialize PAM." + ex.getMessage()); throw new AuthenticationServiceException("Unable to Initialize PAM - ", ex); } return authenticateViaPam(pam, authentication); } else { return null; } } }
AmbariPamAuthenticationProvider implements AuthenticationProvider { @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { if(isPamEnabled()){ PAM pam; try{ String pamConfig = configuration.getPamConfigurationFile(); pam = new PAM(pamConfig); } catch(PAMException ex) { LOG.error("Unable to Initialize PAM." + ex.getMessage()); throw new AuthenticationServiceException("Unable to Initialize PAM - ", ex); } return authenticateViaPam(pam, authentication); } else { return null; } } @Inject  AmbariPamAuthenticationProvider(Configuration configuration); }
AmbariPamAuthenticationProvider implements AuthenticationProvider { @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { if(isPamEnabled()){ PAM pam; try{ String pamConfig = configuration.getPamConfigurationFile(); pam = new PAM(pamConfig); } catch(PAMException ex) { LOG.error("Unable to Initialize PAM." + ex.getMessage()); throw new AuthenticationServiceException("Unable to Initialize PAM - ", ex); } return authenticateViaPam(pam, authentication); } else { return null; } } @Inject  AmbariPamAuthenticationProvider(Configuration configuration); @Override Authentication authenticate(Authentication authentication); @Override boolean supports(Class<?> authentication); }
AmbariPamAuthenticationProvider implements AuthenticationProvider { @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { if(isPamEnabled()){ PAM pam; try{ String pamConfig = configuration.getPamConfigurationFile(); pam = new PAM(pamConfig); } catch(PAMException ex) { LOG.error("Unable to Initialize PAM." + ex.getMessage()); throw new AuthenticationServiceException("Unable to Initialize PAM - ", ex); } return authenticateViaPam(pam, authentication); } else { return null; } } @Inject  AmbariPamAuthenticationProvider(Configuration configuration); @Override Authentication authenticate(Authentication authentication); @Override boolean supports(Class<?> authentication);  }