Skip to content

Commit

Permalink
OPHYK-286 fix caller id for viestinvalityspalvelu
Browse files Browse the repository at this point in the history
  • Loading branch information
tokarls committed Nov 1, 2024
1 parent f6898ae commit 1d775dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import java.net.http.HttpResponse;
import java.time.Duration;

import fi.vm.sade.kayttooikeus.config.HttpClientConfiguration;

@Slf4j
public abstract class CasAuthenticatedServiceClient {
protected final HttpClient httpClient;
Expand All @@ -25,7 +27,7 @@ protected CasAuthenticatedServiceClient(HttpClient httpClient, CasClient casClie
protected HttpResponse<String> sendRequest(HttpRequest.Builder requestBuilder) throws IOException, InterruptedException {
log.info("Sending CAS authenticated request");
requestBuilder.timeout(Duration.ofSeconds(35))
.header("Caller-Id", "1.2.246.562.10.00000000001.organisaatio-service")
.header("Caller-Id", HttpClientConfiguration.CALLER_ID)
.header("CSRF", "CSRF")
.header("Cookie", "CSRF=CSRF");
var response = httpClient.send(requestBuilder.build(), HttpResponse.BodyHandlers.ofString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public class HttpClientConfiguration {

private static final Logger LOGGER = LoggerFactory.getLogger(HttpClientConfiguration.class);
private static final String CALLER_ID = "1.2.246.562.10.00000000001.kayttooikeus-service.backend";
public static final String CALLER_ID = "1.2.246.562.10.00000000001.kayttooikeus-service.backend";

public static final String DEFAULT_TIMEOUT = String.valueOf(10000);
public static final String HTTP_CLIENT_OPPIJANUMEROREKISTERI = "httpClientOppijanumerorekisteri";
Expand Down

0 comments on commit 1d775dd

Please sign in to comment.