@Test(expected = AuthenticationException.class) public void testBadCredential() throws Exception { Authentication authentication = new UsernamePasswordAuthenticationToken("notFound", "wrong"); authenticationProvider.authenticate(authentication); }
@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);  }