How to prevent user consent window in a self-sign in application?

Ludovic Levacher 20 Reputation points
2023-04-05T10:00:22.45+00:00

I created a single page application based on this tuto: https://learn.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-javascript-auth-code I've modified it to access business central api using this scope: "https://api.businesscentral.dynamics.com/.default". My issue is that when the user signs-in, a consent window is displayed. User's image

Is there a way to by pass this and prevent it to be shown to the user? Thanks in advance

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,752 questions
0 comments No comments
{count} votes

Accepted answer
  1. Rohit Kumar Sinha 1,336 Reputation points
    2023-04-05T10:14:04.1+00:00

    You can bypass this page, if a Global Admin gives the consent for this scope for all the users in the organization. In that way the consent page wont pop up whenever the users accesses it with their accounts the first time. A Global Admin can consent in two ways:

    1. Using the portal: Application Registration --> Select the application from the list and open --> Select API Permissions ---> Check for the button "Grant admin consent for the AzureAD-Environment" Note: Once you hit on this button, the status column for the scope User.Read would get a green check mark, which means this admin consent is done for that scope and only for that application, but for all the users in that tenant.  
    2. By Global Admin himself accessing the application and providing the consent on behalf of all the users. If the above is useful please click Accept Answer.
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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