We have an Angular app where the user gets authenticated the following way:
- When user tries to log in, the client (Angular) redirects the user to another server, the authentication manager
- User enters the credentials on the authentication server's UI
- the authentication server validates the user and if successful, it redirects the user back to the Angular client. When the redirection happens, the authentication server also includes a custom header that contains the user's userId.
My question is, how can I access this header from within Angular? I looked high and low but I only see examples where we can look at the response following a request we make from within Angular. However, in this case the request was made by the authentication server when it made the redirection to the Angular client so I want to retrieve this header when the page first loads.
This application replaces a legacy jsp application that used the same authentication flow and it worked well there but I am not sure if Angular can handle this situation.
Not sure if it matters, our implementation is running on top of Node Js.
Many thanks!