In the case of CROSS ORIGIN request read this:
I faced this situation and at first I chose to use the Authorization
Header and later removed it after facing the following issue.
Authorization
Header is considered a custom header. So if a cross-domain request is made with the Autorization
Header set, the browser first sends a preflight request. A preflight request is an HTTP request by the OPTIONS method, this request strips all the parameters from the request. Your server needs to respond with Access-Control-Allow-Headers
Header having the value of your custom header (Authorization
header).
So for each request the client (browser) sends, an additional HTTP request(OPTIONS) was being sent by the browser. This deteriorated the performance of my API. You should check if adding this degrades your performance. As a workaround I am sending tokens in http parameters, which I know is not the best way of doing it but I couldn't compromise with the performance.