I'm currently having an unusual issue with azure b2c user flows.
The scenario of the issue:
I have many users and sometimes (not all of them) they get stuck in a loop when they try to log in. They have to perform successfully log-in in 2 or 3 times in a row just to finally get access to the application.
So far I couldn't find any solution or any reason for this behavior. Is this a common trouble using azure b2c or it could be something related to the network?
Any advice or clue would be great!
First you need to confirm where the 'loop' is happening. It's either happening:
Determine this by using Fiddler or logs (application logs and Azure AD B2C logs)
If Within Azure AD B2C policy, there's something misconfigured within your policy
If Between App and Azure AD B2C, either your application is not parsing the token correctly - this could be MSAL not setup correctly, it's thinking the token isn't valid or it's expired, or even missing some claim. To fix this, look at the application logs first to see if it states why it's having to automatically make a new request.
Network related is always a factor to consider - especially if you have a WAF. Again, always check your logs before trying to change anything. Additionally, always test with multiple browsers (if this is a web app) since browsers can be bad actors when testing - especially with session management.