My application is being lazy loaded by a larger application when the user selects it from a menu. By this time the user is already authenticated and has proper roles, but due to the segmentation in the groups' apps, I still have to semi authenticate the user, by sending the username and special key to the server, for which I then get a token.
That token has to get loaded before I can do any other data requests. Right now I have a data service and part of it's constructor does this login. Unfortunately because http client is asynchronous, this means the first component from my app that is loaded fails to make it's data calls because the data service has just gotten created at this point...
Where should I be getting this token to avoid this?