When calling my REST Service in Angular, there are no response headers.
Login method in Angular
By default CORS responses only expose these 6 headers :
Cache-ControlContent-LanguageContent-TypeExpiresLast-ModifiedPragmaTo allow the scripts to access other headers sent by the sever, the server needs to send the Access-Control-Expose-Headers Header.
The Access-Control-Expose-Headers response header indicates which headers can be exposed as part of the response by listing their names.
eg: Access-Control-Expose-Headers: Authorization, X-Foobar
You can tweak your web.xml file including this to allow the Authorization header to be accessed from the script that made the XHR:
cors.exposedHeaders
Authorization