Skip to content

Commit

Permalink
Merge pull request #332 from reportportal/EPMRPP-90137
Browse files Browse the repository at this point in the history
EPMRPP-90137 || Change ad timeout
  • Loading branch information
pbortnik committed Aug 26, 2024
2 parents f737f3d + d47c80e commit ae07128
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@

package com.epam.reportportal.auth.integration.ldap;

import static com.epam.reportportal.auth.integration.ldap.LdapAuthProvider.LDAP_TIMEOUT;

import com.epam.reportportal.auth.EnableableAuthProvider;
import com.epam.reportportal.auth.integration.AuthIntegrationType;
import com.epam.reportportal.auth.integration.parameter.LdapParameter;
import com.epam.ta.reportportal.dao.IntegrationRepository;
import com.epam.ta.reportportal.entity.integration.Integration;
import java.util.Collections;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.BadCredentialsException;
Expand Down Expand Up @@ -61,10 +64,11 @@ protected AuthenticationProvider getDelegate() {
ActiveDirectoryLdapAuthenticationProvider adAuth =
new ActiveDirectoryLdapAuthenticationProvider(LdapParameter.DOMAIN.getParameter(integration)
.orElse(null),
LdapParameter.URL.getRequiredParameter(integration),
LdapParameter.BASE_DN.getRequiredParameter(integration)
);

LdapParameter.URL.getRequiredParameter(integration),
LdapParameter.BASE_DN.getRequiredParameter(integration)
);
adAuth.setContextEnvironmentProperties(
Collections.singletonMap("com.sun.jndi.ldap.connect.timeout", LDAP_TIMEOUT));
adAuth.setAuthoritiesMapper(new NullAuthoritiesMapper());
adAuth.setUserDetailsContextMapper(detailsContextMapper);
LdapParameter.SEARCH_FILTER_REMOVE_NOT_PRESENT.getParameter(integration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
public class LdapAuthProvider extends EnableableAuthProvider {

//millis
private static final String LDAP_TIMEOUT = "3000";
public static final String LDAP_TIMEOUT = "3000";
private final DetailsContextMapper detailsContextMapper;

@Autowired
Expand Down

0 comments on commit ae07128

Please sign in to comment.