I route a user to another web site from my Angular application using $window.open(url, '')
. Currently they are directed to the login page but now there is a requirement for single sign on so the user can access the external site if they are logged in to my application. The external site has asked that I send a JavaScript Web Token in the Authorisation Header using the Bearer schema when I redirect the user.
How can I set the Authorization header in Angular when sending a user to anther site. I've only ever used the header in the context of communicating with an API ($http.get()
), rather than sending the user elsewhere. I don't think $window.open
has any means to do this so I might need to use something else.
Although this question is similar, the answer describes sending the token as a get parameter in the URL. The Authorization header is not used. how to add authentication header to $window.open