Share via

Microsoft oauth screen issues

Dumbre, Rohit 0 Reputation points
2025-09-16T18:22:20.43+00:00

Hi,

We are observing an issue related to the oauth screen. If a user happens to double click or do additional clicks on the microsoft account microsoft generates multiple triggers. There triggers causes multiple callback being triggered making our applications invalidate the request preventing login.

Is there a way to prevent this behaviour. Since the oauth screen is handled by outlook what can be done here.

Outlook | Windows | Classic Outlook for Windows | For business
0 comments No comments

2 answers

Sort by: Most helpful
  1. Dumbre, Rohit 0 Reputation points
    2025-09-17T17:50:50.2766667+00:00

    The additional clicks are done on the microsoft screen and it is generating triggers. How a ui change work in this case since the control is gone to microsoft.
    Is there a way to prevent microsoft from showing this account and force the user to enter the username and password everytime. In this case double clicks wont be a problemimage (2)

    Was this answer helpful?


  2. Teddie-D 15,965 Reputation points Microsoft External Staff Moderator
    2025-09-17T01:38:58.9233333+00:00

    Hi @Dumbre, Rohit
    Thank you for posting your question in the Microsoft Q&A forum. 

    This is a common challenge many developers face when integrating OAuth flows. While the login and consent screens are managed by Microsoft and can't be directly modified to debounce or block extra clicks, there are several effective strategies you can implement on your end to protect your application against multiple callback issues: 

    -Disable the login button immediately after the first click. 
    A simple UI change helps prevent users from unintentionally triggering multiple login attempts, which can lead to duplicate requests and session confusion. 

    -Validate the login session on your server.  
    Accept only the first valid callback. Your backend should track each login attempt using a unique session identifier or timestamp. Once a callback is successfully processed, mark it as consumed (e.g., loginProcessed = true) and gracefully ignore any subsequent callbacks with the same state or code. 

     Generate and store a unique state parameter for each login attempt. This ensures that each authentication flow is traceable and prevents replay attacks or accidental reprocessing. 
    Please refer to Pass custom state in authentication requests (MSAL.js) | Azure Docs 

    -Use Microsoft Authentication Libraries (MSAL) with proper redirect handling. 
    Microsoft Authentication Libraries support passing custom state parameters and managing redirects effectively. You can read more at Authentication configuration options - Microsoft Authentication Library for JavaScript | Microsoft …

    -If your app supports it, consider switching to popup login, which can help avoid full-page reloads and reduce the likelihood of duplicate submissions. 
    I hope these suggestions help you build a more resilient authentication flow. 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".   

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.  

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.