After setting up a new angular 4 project using the angular cli, I have configured it to communicate with a web api that returns the current user's Windows username. To minimize the number of API calls necessary, I want to find the optimal placement within the Angular application to make this call. The application consists of multiple pages, so the challenge is to ensure the user can access their Windows username without needing to make repeated requests.
Queries
Where in the Angular application should I make the API call to retrieve the Windows username just once?
How can I securely store the Windows username to prevent it from expiring during the user's session on the application?