I have to pass a token (string) in a HTTP request header to a 3rd party web application. ie from my java web application, I will set the HTTP request header value and the 3rd party web application will receive the HTTP request header.
I have successfully set the request header from my Spring MVC controller and verified it by redirecting it to a simple jsp file in the same application.
Then I tried perform a Redirect to the simulated 3rd party web application , Unfortunately the token request header is never displayed on the simulated 3rd party web application.
I believe that I am setting the request header correctly so the problem might be with the way I am attempting to transfer it to the simulated 3rd party web application.
Here's the code I used in my spring Controller for redirection,
HttpServletRequest request = new CustomHttpServletRequest(httprequest);
CustomRedirectView rv = new CustomRedirectView();
rv.sendRedirect(request, response, "redirectUrl", true);
where CustomHttpServletRequest - class which extends HttpServletRequestWrapper and i have overridden getHeader method as per my requirement
CustomRedirectView - class which extends RedirectView
redirectUrl - redirect url for the 3rd party web application
I will be really grateful for any help or advice on this challenge.