I'm developing a web service that consumes another one. To authenticate with this other service, I have to use the SAML V2 protocol. How to programmatically consume this service in Java ?
My code without SSO:
HttpClient client = builder.build();
URIBuilder uriBuilder = new URIBuilder();
uriBuilder.setScheme(test.getScheme());
uriBuilder.setHost(test.getHost());
uriBuilder.setPort(test.getPort());
uriBuilder.setPath("Path");
uriBuilder.addParameter("id","theID");
uriBuilder.addParameter("param", "param");
try {
HttpUriRequest request = new HttpGet(uriBuilder.build());
HttpResponse response = client.execute(request);
return EntityUtils.toString(response.getEntity());
} catch (IOException | URISyntaxException e) {
e.printStackTrace();
}