I am trying to get an access token from Microsoft Intra ID with Postman. I have created an app registrations with a secret:
The App registration has User.Read permission:
I have set up following authentication:
In postman I have following:
In the URL I Have a post with: https://login.microsoftonline.com/{{tenantId}}/oauth2/v2.0/authorize
In the Auth tab I have following:
When I click Get New Access Token PostMan opens a browser, and I can enter my credentials and MFA. However I get following error message:
The error "Need admin approval" usually occurs if the user consent is disabled in the tenant level or if the admin consent is not granted to the Microsoft Entra ID application API permissions.
In your scenario as you granted User.Read
API permission and as this API permission do not require admin consent cross verify if the user consent is disabled.
Initially I registered a Microsoft Entra ID application and added API permissions:
And got the same error:
To resolve the error, enable the user consent flow like below:
Go to Azure Portal -> Enterprise application -> Consent and permissions -> User consent settings -> Enable the option Allow user consent for apps -> Save
To configure the below setting, you need to have Privileged Role Administrator role or Global Admin role.
After the above setting, wait for some time and try to authorize user
I used the below endpoint to authorize the user:
https://login.microsoftonline.com/TenantID/oauth2/v2.0/authorize?
&client_id=ClientID
&response_type=code
&redirect_uri=RedirectURL
&response_mode=query
&scope=openid profile user.read
&state=12345
The user is authorized successfully:
Tokens are generated successfully:
GET https://login.microsoftonline.com/TenantID/oauth2/v2.0/token
client_id : ClientID
grant_type : authorization_code
scope : scope
redirect_uri : RedirectURL
code : Code
client_secret : ClientSecret
You can also try to configure Admin consent workflow if still the issue persists.
Reference:
Configure how users consent to applications - Microsoft Entra ID | Microsoft