I have an Angular App authenticating against an Azure Active Directory via MSAL using OAuth 2.0 Implicit Grant flow. I was able to track the progress of my request up until the point where the sign-in request - https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize?client_id={client id}&response_type=id_token&redirect_uri={redirect uri}&scope=openid&response_mode=fragment&state=12345&nonce=678910 returns the appropriate response which is GET https://{host}/#id_token={token}&state=12345
However, as soon as this request finishes, the app throws the user back to the sign-in page. After 3 or 4 sign-in attempts, the user is finally redirected to https://{host}/null. Again repeatedly attempting to login by removing null finally successfully logs the user in.
Couple of points to note:
- I can see that Session Storage is not populated with the id token despite signing in successfully and getting the appropriate response as described above
- After finally successfully logging in, the Session Storage is now populated with all of the information
The above leads me to believe that my angular app is getting the token after a successful sign-in, but is somehow not setting the same in the Session Storage the first couple of times around.