Admin consent page keeps coming up during OAuth process even after authorisation is granted by admin

Vasanth N 1 Reputation point
2022-11-17T09:40:54.897+00:00

I am developing an application to integrate with Microsoft's email services using OAuth. The application works fine when the user initiating the process has sufficient permissions to authorise it. In cases where the permissions are not available a request admin consent prompt is displayed. Once user requests for consent, the admin approves the application and adds the user to it, the user retries the OAuth process. However, the request admin consent page still comes up. This seems to be ever looping.

Not sure if I'm missing anything. Any help would be appreciated.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,473 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Cristian SPIRIDON 4,471 Reputation points
    2022-11-17T13:23:07.513+00:00

    Hi,

    If you want that the admin consent to be persistent you need to go to Enterprise app and add to you app all the admin consent it needs.

    Hope this helps!

    0 comments No comments

  2. 2022-11-22T22:31:35.363+00:00

    Hello @Vasanth N and thanks for reaching out. For the admin consent prompt to keep appearing, admin consent must not have yet been provided. Is not needed to add a user to an application to grant it consent unless user assignment is required. Alternatively, you might try granting tenant wide consent to the app.

    If the issue persists, please create an Azure Support Request ensuring Advanced diagnostic collection is enabled and request it to be assigned to Alfredo Revilla, that's me :)

    Let us know if you need additional assistance. If the answer was helpful, please accept it and complete the quality survey so that others can find a solution.

    0 comments No comments