logo
search
Security Policy Errors

How to Fix Microsoft Defender for Cloud Apps API Token Admin Approval Error

Camila MilosovichCamila Milosovich Oct 23, 2026 868 views

Question details

The user's Python application fails to obtain an MSAL access token for the Microsoft Defender for Cloud Apps API due to an administrator approval requirement.

How to Fix Microsoft Defender for Cloud Apps API Token Admin Approval Error
Product
Microsoft Defender for Cloud Apps, Microsoft Entra ID
Device & OS
not provided
Scenario
Authenticating a Python application using MSAL to access the Defender for Cloud Apps API.
Observed behavior
The sign-in response returns an error stating that administrator approval is required, even though the necessary API permissions were added to the app registration.
Before you start

Ensure you have Global Administrator or Privileged Role Administrator rights in your Microsoft Entra ID (formerly Azure AD) tenant to grant the necessary consent.

Solution 1Recommended

Grant Tenant-Wide Admin Consent in Microsoft Entra ID

Resolve the admin approval error by having a tenant administrator grant tenant-wide consent for the requested API permissions.

Many high-privilege APIs, including Microsoft Defender for Cloud Apps, require administrative consent before an application can request access tokens. This prevents unauthorized applications from accessing sensitive organizational data.

1
Access Entra admin center

Log in to the Microsoft Entra admin center (or Azure portal) using an account with administrator credentials.

2
Navigate to App registrations

Go to 'Identity', then select 'Applications', and click on 'App registrations'. Find and select your registered Python application.

3
Open API permissions

Click on 'API permissions' from the left-hand menu to view the currently configured permissions for your application.

4
Grant admin consent

Click the 'Grant admin consent for [Your Tenant Name]' button located above the permissions list, and confirm the action when prompted.

Grant Tenant-Wide Admin Consent in Microsoft Entra ID
Check Consent Policies: If the consent button is disabled, verify your tenant's user consent policies or ensure you are logged in with the appropriate administrative role.
Free Microsoft Office alternative

Boost Your Productivity with WPS Office

While configuring API permissions and managing tenant consent in Microsoft Entra ID requires specific admin tools, your daily documentation doesn't have to be complicated. WPS Office provides a lightweight, comprehensive suite for all your document, spreadsheet, and presentation needs without the complex configurations.

Highly compatible with Microsoft Word, Excel, and PowerPoint file formats.Lightweight design ensures fast startup and smooth performance even on older devices.Familiar and intuitive user interface requires zero learning curve.Built-in PDF editing tools for easy document management and collaboration.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my MSAL Python app require admin approval?

In Microsoft Entra ID, certain high-privilege APIs, including Microsoft Defender for Cloud Apps, require an administrator to review and consent to the permissions before the application can request tokens on behalf of users or the tenant.

Who can grant admin consent in Microsoft Entra ID?

Only users with specific administrative roles, such as Global Administrator, Privileged Role Administrator, or Cloud Application Administrator, have the authority to grant tenant-wide admin consent for application permissions.

What should I do if the 'Grant admin consent' button is grayed out?

If the button is grayed out, it typically means your current account lacks the necessary administrative permissions in the Entra ID tenant. Contact your organization's IT admin to grant consent on your behalf.

Where can I find further support for Microsoft Defender for Cloud Apps API issues?

For specialized developer and API integration issues, it is recommended to consult the Microsoft Defender for Cloud Apps Q&A community or the MSAL for Python GitHub issue tracker for expert assistance.