I am working on a Java application. The front end will be Angular2 .
If I try to open the home page of my application ( index.html is configured in web.xml as the default page ). The access URL should be http: // localhost: 8080 / MyWebApp .
Then I took the standard organization authentication page for authentication. If authentication is complete, the HTTP authorization token will be set in the request header, and finally the control will display my application home page.
If I use jsp , I can get the request header as,
String authHeader = request.getHeader("authorization"); out.println("<h2>HTTP Authorization header:</h2>"); if (authHeader == null) { out.print("No authorization header"); } else { out.print("<textarea readonly id='authHeader' rows=\"5\" cols=\"80\">" + authHeader + "</textarea>"); }
But we use html as front end, because of angular 2 .
So, for my scenario, how can I get the request header and .
Please feel free to edit my question if this is not clear.
source share