Prompt=consent when requiring admin approval results in the oauth flow never working

Daniel Dunér 1 Reputation point
2022-11-24T14:43:17.247+00:00

Hi, I have built an application where I require some permissions that needs admin consent. This ends up with the oauth flow asking for consent each time not noticing that the request was approved? Do you have a solution to this?

If I don't have prompt=consent, the user will not be shown which permission they consent to by logging in, which I want them to see.

263958-image.png

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,713 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 95,836 Reputation points MVP
    2022-11-24T14:55:43.97+00:00

    This is by design - if you specify said parameter, the consent process will always be triggered. In fact, this is one of the scenarios explicitly flagged in the "troubleshooting consent" article: https://learn.microsoft.com/en-us/azure/active-directory/manage-apps/application-sign-in-unexpected-user-consent-prompt
    If a given user hasn't already consented to your app or no admin consent was granted, they will be prompted to do so, whether you include this parameter or not. There is no need to use it with every request.