Right now, the service level calls are using HttpURLConnection. HttpURLConnection provides a blank slate to make a request with few default values. Session values are not preserved by default, so this means manually setting an x-auth-token or JSESSIONID when authenticating and making a request to another endpoint behind authentication.
There are many libraries for Java that will preserve a session as calls are made, automatically saving session information for future requests. A few different options exist, such as HttpClient, Jetty Http Client, and OkHttpClient
A small POC should be created for each of these and compared in order to choose the best, most well-suited option.
Right now, the service level calls are using HttpURLConnection. HttpURLConnection provides a blank slate to make a request with few default values. Session values are not preserved by default, so this means manually setting an x-auth-token or JSESSIONID when authenticating and making a request to another endpoint behind authentication.
There are many libraries for Java that will preserve a session as calls are made, automatically saving session information for future requests. A few different options exist, such as HttpClient, Jetty Http Client, and OkHttpClient
A small POC should be created for each of these and compared in order to choose the best, most well-suited option.