Hi @Kundan Kumar , it looks like the image didnt upload, if you want to try again. This may be caused by a misconfiguration in your Azure AD OpenID Connect settings or in your application code.
Can you please follow these troubleshooting steps and let me know if they help?
- Check your Azure AD OpenID Connect settings to ensure that the redirect URIs are configured correctly. The redirect URI should match the URL of your application, including the port number. If the redirect URI is not configured correctly, it can cause an infinite redirect loop.
- Check your application code to ensure that it is handling the OpenID Connect authentication flow correctly. Make sure that your code is properly handling the authorization code flow and exchanging the authorization code for an access token. If there is an error in the authentication flow, it can cause an infinite redirect loop.
- Check your application code to ensure that it is properly handling the
state
parameter. Thestate
parameter is used to prevent cross-site request forgery (CSRF) attacks. If thestate
parameter is not handled correctly, it can cause an infinite redirect loop. - Check your application code to ensure that it is properly handling the
nonce
parameter. Thenonce
parameter is used to prevent replay attacks. If thenonce
parameter is not handled correctly, it can cause an infinite redirect loop. - Check your application code to ensure that it is properly handling the
session_state
parameter. Thesession_state
parameter is used to maintain the user's session state. If thesession_state
parameter is not handled correctly, it can cause an infinite redirect loop.
For the issue where the URL works on the second click, it is possible that the authentication flow is not completing successfully on the first attempt, but is completing successfully on the second attempt. It may be resolved with a fix above as well.
Please let me know if you have any questions and I can help you further.
If this answer helps you please mark "Accept Answer" so other users can reference it.
Thank you,
James