use of com.epam.reportportal.auth.store.entity.ldap.ActiveDirectoryConfig in project service-authorization by reportportal.
the class ActiveDirectoryAuthProvider method getDelegate.
@Override
protected AuthenticationProvider getDelegate() {
ActiveDirectoryConfig adConfig = authConfigRepository.findActiveDirectory(true).orElseThrow(() -> new BadCredentialsException("Active Directory is not configured"));
ActiveDirectoryLdapAuthenticationProvider adAuth = new ActiveDirectoryLdapAuthenticationProvider(adConfig.getDomain(), adConfig.getUrl(), adConfig.getBaseDn());
adAuth.setAuthoritiesMapper(new NullAuthoritiesMapper());
adAuth.setUserDetailsContextMapper(new DetailsContextMapper(ldapUserReplicator, adConfig.getSynchronizationAttributes()));
return adAuth;
}
use of com.epam.reportportal.auth.store.entity.ldap.ActiveDirectoryConfig in project service-authorization by reportportal.
the class AbstractAuthSequenceProviderTest method shouldFailValidationWithNullInputValuesForTextField.
@Test
public void shouldFailValidationWithNullInputValuesForTextField() {
ActiveDirectoryConfig adConfig = new ActiveDirectoryConfig();
adConfig.setEnabled(true);
final Set<ConstraintViolation<ActiveDirectoryConfig>> constrants = validator.validate(adConfig);
Assert.assertThat(constrants.size(), CoreMatchers.is(3));
}
Aggregations