I am creating a REST end point which need to redirect user to a page after checking Authorization Bearer token for authenticity of request. I have created the end point to redirect using Location header at server side. Till this point its good.
Now I am trying to simulate an action in html that can POST or GET to the above service by passing authorization header. How can i get this redirection working?
I have tried using XMLHttpRequest and ajax requests, but browser handles the redirect on its own and send back the target url content in the success callback. But i would want to open the new tab instead with target URL.