Granting access to specific Microsoft Entra resources
App permissions in Microsoft Entra allow an application to access specific data or perform actions on behalf of a user or the organization. These are defined as scopes or roles that must be granted by an administrator or the user.
- Permission types Delegated and Application permissions
- Grant method Admin consent or user consent
- Scope level User data or organizational data
Deciding Between Delegated and Application Permissions
The most common mistake when setting up an application is choosing the wrong permission type. This mistake can either break the application functionality or create a massive security hole. In Microsoft Entra, permissions are not one-size-fits-all; they depend entirely on whether a human is actively using the app or if the app is running on its own in the background.
Delegated permissions are used when an application needs to access resources on behalf of a signed-in user. In this scenario, the application can only do what the user is allowed to do. For example, if a user only has permission to read their own emails, a third-party calendar app using delegated permissions cannot read the emails of the entire company. The application acts as a proxy for the user's identity. The security of this model relies on the user's existing permissions. If the user is removed from a group or loses access to a file, the application loses that access immediately because it is tied to that user's session.
Application permissions, often called app-only permissions, are used when the application runs without a signed-in user. This is common for background services, automated scripts, or synchronization tools that run on a schedule. Because there is no user present to provide a session, the application uses its own identity (service principal) to access data. This is significantly more powerful and potentially dangerous. If an application has the 'User.Read.All' application permission, it can read the profile information of every single person in the directory, regardless of who is logged in. This type of permission almost always requires administrator consent.
To choose correctly, ask if the app needs to act as a person or as a system. If the app is a mobile tool for employees to check their own schedules, use delegated permissions. If the app is a server-side script that generates reports for the entire company every night at 2:00 AM, use application permissions.
Granting Consent to Requested Scopes
Once an application has defined which permissions it needs, those permissions must be approved. This process is known as consent. Microsoft Entra handles consent in two distinct ways depending on the sensitivity of the requested data and the settings of your organization.
- User Consent: This occurs when a user signs into an application and is presented with a screen listing the permissions the app is requesting. If the permissions are low-risk, such as reading a user's basic profile, an administrator may have configured the tenant to allow users to approve these themselves. The user clicks 'Accept', and the app receives a token to proceed.
- Admin Consent: For high-privilege permissions, a standard user cannot grant access. When the app requests something like 'Directory.Read.All' or 'Mail.Read', the user will see a message stating that the app requires administrator approval. An IT administrator must then log into the Microsoft Entra admin center and manually grant consent for the entire organization. This creates a single 'grant' that covers all users in the tenant.
- Pre-authorized Consent: In some enterprise environments, administrators use automated workflows to pre-approve certain trusted applications. This prevents users from seeing consent prompts entirely for known, safe software.
A common error is attempting to use user consent for permissions that require admin consent. When this happens, the application will simply fail to authenticate, often returning an error code that indicates 'consent_required'. If you encounter this, you must move to the admin center to finalize the process. Labels for these menus may differ slightly depending on your version of the interface, but the logic remains the same.
Reviewing App Permissions for Security Compliance
Regularly auditing which applications have access to your data is a critical part of identity management. Over time, applications may be granted permissions that are no longer needed, or new applications may be added that pose a risk. You should check your permission settings using the following criteria:
| Permission Type | Risk Level | Primary Use Case |
|---|---|---|
| Low-level Delegated | Low | Reading user's own profile or basic contact info. |
| High-level Delegated | Medium | Accessing user's mailbox or files on their behalf. |
| Application Permissions | High | Automated background services and system integrations. |
When performing a review, look for "over-permissioning." This is the practice of granting an application more access than it actually needs to function. For example, if an app only needs to read files in one specific folder, do not grant it 'Files.Read.All', which allows it to read every file in every user's OneDrive. Instead, look for more granular permissions if the API supports them. If an application has not been used in several months, consider revoking its permissions entirely. Revoking consent removes the application's ability to access any data, effectively cutting its connection to your identity provider.
To check current permissions, navigate to the Microsoft Entra admin center, select 'Applications', then 'Enterprise applications'. From there, you can select a specific application and view its 'Permissions' menu. This list shows exactly what the app is allowed to do and whether those permissions were granted by a user or an admin.
Preventing Permission Creep and Unauthorized Access
Permission creep occurs when users or administrators continue to add permissions to an application without ever removing the old ones. This creates a massive attack surface. If a single application is compromised, the attacker inherits every permission that application has been granted. If that app has 'Application' level permissions for the entire directory, the attacker has the keys to the kingdom.
To manage this, follow a strict rule of thumb: Always apply the Principle of Least Privilege (PoLP). This means you should only grant the absolute minimum level of access required for the application to perform its specific task. If an application can function with 'User.Read', do not give it 'User.Read.All'. If it can function with delegated permissions, do not use application permissions.
Another way to prevent issues is to control user consent settings. In the Microsoft Entra admin center, you can find settings under 'User settings' that allow you to restrict users from consenting to apps themselves. By disabling user consent for most permissions, you force every new application to go through an administrative review process. This ensures that no rogue or poorly coded application can access company data without an IT professional first evaluating the requested scopes.
If you notice an application requesting unusual permissions, such as the ability to read all mail or modify directory settings, investigate the source immediately. Check if the application is a known, trusted vendor. If it is an internal script, verify with the developer why those specific scopes are necessary. Often, developers use broad permissions during the testing phase and forget to tighten them before moving to production. This is a major security gap that must be closed before the application is deployed to a live environment.
Further reading: Microsoft Support