You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/active-directory/manage-apps/grant-admin-consent.md
+146-6Lines changed: 146 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,18 @@
1
1
---
2
2
title: Grant tenant-wide admin consent to an application
3
-
description: Learn how to grant tenant-wide consent to an application so that end-users are not prompted for consent when signing in to an application.
3
+
description: Learn how to grant tenant-wide consent to an application so that end-users aren't prompted for consent when signing in to an application.
#customer intent: As an admin, I want to grant tenant-wide admin consent to an application in Azure AD.
17
18
---
@@ -20,13 +21,11 @@ ms.custom: contperf-fy22q2
20
21
21
22
In this article, you'll learn how to grant tenant-wide admin consent to an application in Azure Active Directory (Azure AD). To understand how individual users consent, see [Configure how end-users consent to applications](configure-user-consent.md).
22
23
23
-
When you grant tenant-wide admin consent to an application, you give the application access on behalf of the whole organization to the permissions requested. Granting admin consent on behalf of an organization is a sensitive operation, potentially allowing the application's publisher access to significant portions of your organization's data, or the permission to do highly privileged operations. Examples of such operations might be role management, full access to all mailboxes or all sites, and full user impersonation.
24
+
When you grant tenant-wide admin consent to an application, you give the application access on behalf of the whole organization to the permissions requested. Granting admin consent on behalf of an organization is a sensitive operation, potentially allowing the application's publisher access to significant portions of your organization's data, or the permission to do highly privileged operations. Examples of such operations might be role management, full access to all mailboxes or all sites, and full user impersonation. Carefully review the permissions that the application is requesting before you grant consent.
24
25
25
26
By default, granting tenant-wide admin consent to an application will allow all users to access the application unless otherwise restricted. To restrict which users can sign-in to an application, configure the app to [require user assignment](application-properties.md#assignment-required) and then [assign users or groups to the application](assign-user-or-group-access-portal.md).
26
27
27
-
Tenant-wide admin consent to an app grants the app and the app's publisher access to your organization's data. Carefully review the permissions that the application is requesting before you grant consent. For more information on consenting to applications, see [Azure Active Directory consent framework](../develop/consent-framework.md).
28
-
29
-
Granting tenant-wide admin consent may revoke any permissions which had previously been granted tenant-wide for that application. Permissions which have previously been granted by users on their own behalf will not be affected.
28
+
Granting tenant-wide admin consent may revoke any permissions that had previously been granted tenant-wide for that application. Permissions that have previously been granted by users on their own behalf won't be affected.
30
29
31
30
## Prerequisites
32
31
@@ -43,6 +42,8 @@ To grant tenant-wide admin consent, you need:
43
42
44
43
You can grant tenant-wide admin consent through *Enterprise applications* if the application has already been provisioned in your tenant. For example, an app could be provisioned in your tenant if at least one user has already consented to the application. For more information, see [How and why applications are added to Azure Active Directory](../develop/active-directory-how-applications-are-added.md).
45
44
45
+
:::zone pivot="portal"
46
+
46
47
To grant tenant-wide admin consent to an app listed in **Enterprise applications**:
47
48
48
49
1. Sign in to the [Azure portal](https://portal.azure.com) with one of the roles listed in the prerequisites section.
@@ -81,6 +82,145 @@ where:
81
82
82
83
As always, carefully review the permissions an application requests before granting consent.
83
84
85
+
86
+
:::zone-end
87
+
88
+
89
+
:::zone pivot="ms-powershell"
90
+
91
+
In the following example, you'll grant delegated permissions defined by a resource enterprise application to a client enterprise application on behalf of all users.
92
+
93
+
In the example, the resource enterprise application is Microsoft Graph of object ID `7ea9e944-71ce-443d-811c-71e8047b557a`. The Microsoft Graph defines the delegated permissions, `User.Read.All` and `Group.Read.All`. The consentType is `AllPrincipals`, indicating that you're consenting on behalf of all users in the tenant. The object ID of the client enterprise application is `b0d9b9e3-0ecf-4bfd-8dab-9273dd055a941`.
94
+
95
+
> [!CAUTION]
96
+
> Be careful! Permissions granted programmatically are not subject to review or confirmation. They take effect immediately.
1. Retrieve all the delegated permissions defined by Microsoft graph (the resource application) in your tenant application. Identify the delegated permissions that you'll grant the client application. In this example, the delegation permissions are `User.Read.All` and `Group.Read.All`
## Grant admin consent for application permissions
133
+
134
+
In the following example, you grant the Microsoft Graph enterprise application (the principal of ID `b0d9b9e3-0ecf-4bfd-8dab-9273dd055a94`) an app role (application permission) of ID `df021288-bdef-4463-88db-98f22de89214` that's exposed by a resource enterprise application of ID `7ea9e944-71ce-443d-811c-71e8047b557a`.
1. Retrieve the app roles defined by Microsoft graph in your tenant. Identify the app role that you'll grant the client enterprise application. In this example, the app role ID is `df021288-bdef-4463-88db-98f22de89214`.
Use [Graph Explorer](https://developer.microsoft.com/graph/graph-explorer) to grant both delegated and application permissions.
166
+
167
+
## Grant admin consent for delegated permissions
168
+
169
+
In the following example, you'll grant delegated permissions defined by a resource enterprise application to a client enterprise application on behalf of all users.
170
+
171
+
In the example, the resource enterprise application is Microsoft Graph of object ID `7ea9e944-71ce-443d-811c-71e8047b557a`. The Microsoft Graph defines the delegated permissions, `User.Read.All` and `Group.Read.All`. The consentType is `AllPrincipals`, indicating that you're consenting on behalf of all users in the tenant. The object ID of the client enterprise application is `b0d9b9e3-0ecf-4bfd-8dab-9273dd055a941`.
172
+
173
+
> [!CAUTION]
174
+
> Be careful! Permissions granted programmatically are not subject to review or confirmation. They take effect immediately.
175
+
176
+
1. Retrieve all the delegated permissions defined by Microsoft graph (the resource application) in your tenant application. Identify the delegated permissions that you'll grant the client application. In this example, the delegation permissions are `User.Read.All` and `Group.Read.All`
177
+
178
+
```http
179
+
GET https://graph.microsoft.com/v1.0/servicePrincipals?$filter=displayName eq 'Microsoft Graph'&$select=id,displayName,appId,oauth2PermissionScopes
180
+
```
181
+
182
+
1. Grant the delegated permissions to the client enterprise application by running the following request.
183
+
184
+
```http
185
+
POST https://graph.microsoft.com/v1.0/oauth2PermissionGrants
1. Confirm that you've granted tenant wide admin consent by running the following request.
196
+
197
+
```http
198
+
GET https://graph.microsoft.com/v1.0/oauth2PermissionGrants?$filter=clientId eq 'b0d9b9e3-0ecf-4bfd-8dab-9273dd055a94' and consentType eq 'AllPrincipals'
199
+
```
200
+
## Grant admin consent for application permissions
201
+
202
+
In the following example, you grant the Microsoft Graph enterprise application (the principal of ID `b0d9b9e3-0ecf-4bfd-8dab-9273dd055a94`) an app role (application permission) of ID `df021288-bdef-4463-88db-98f22de89214` that's exposed by a resource enterprise application of ID `7ea9e944-71ce-443d-811c-71e8047b557a`.
203
+
204
+
1. Retrieve the app roles defined by Microsoft graph in your tenant. Identify the app role that you'll grant the client enterprise application. In this example, the app role ID is `df021288-bdef-4463-88db-98f22de89214`
205
+
206
+
```http
207
+
GET https://graph.microsoft.com/v1.0/servicePrincipals?$filter=displayName eq 'Microsoft Graph'&$select=id,displayName,appId,appRoles
208
+
```
209
+
1. Grant the application permission (app role) to the client enterprise application by running the following request.
210
+
211
+
```http
212
+
POST https://graph.microsoft.com/v1.0/servicePrincipals/7ea9e944-71ce-443d-811c-71e8047b557a/appRoleAssignedTo
# Review permissions granted to enterprise applications
22
22
23
23
In this article, you'll learn how to review permissions granted to applications in your Azure Active Directory (Azure AD) tenant. You may need to review permissions when you've detected a malicious application or the application has been granted more permissions than is necessary.
24
24
25
-
The steps in this article apply to all applications that were added to your Azure Active Directory (Azure AD) tenant via user or admin consent. For more information on consenting to applications, see [Azure Active Directory consent framework](../develop/consent-framework.md).
25
+
The steps in this article apply to all applications that were added to your Azure Active Directory (Azure AD) tenant via user or admin consent. For more information on consenting to applications, see [User and admin consent](user-admin-consent-overview.md).
26
26
27
27
## Prerequisites
28
28
@@ -32,7 +32,7 @@ To review permissions granted to applications, you need:
32
32
- One of the following roles: Global Administrator, Cloud Application Administrator, Application Administrator.
33
33
- A Service principal owner who isn't an administrator is able to invalidate refresh tokens.
34
34
35
-
## Review application permissions
35
+
## Review permissions
36
36
37
37
:::zone pivot="portal"
38
38
@@ -53,6 +53,9 @@ Each option generates PowerShell scripts that enable you to control user access
53
53
54
54
:::zone pivot="aad-powershell"
55
55
56
+
## Revoke permissions
57
+
58
+
56
59
Using the following Azure AD PowerShell script revokes all permissions granted to an application.
0 commit comments