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
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).
23
23
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.
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.
25
25
26
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).
27
27
28
-
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).
29
-
30
28
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.
31
29
32
30
## Prerequisites
@@ -90,40 +88,36 @@ As always, carefully review the permissions an application requests before grant
90
88
91
89
:::zone pivot="ms-powershell"
92
90
93
-
In the following example, the application is Microsoft Graph. The object ID of Microsoft Graph in the tenant is b0d9b9e3-0ecf-4bfd-8dab-9273dd055a94. The delegated permissions `User.Read.All` and `Group.Read.All` are identified by the globally unique IDs `a154be20-db9c-4678-8ab7-66f6cc099a59` and `5f8c59db-677d-491f-a6b8-5f174b11ec1d respectively`. The consentType is AllPrincipals, indicating that you're consenting on behalf of all users in the tenant.
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
94
95
95
> [!CAUTION]
96
96
> Be careful! Permissions granted programmatically are not subject to review or confirmation. They take effect immediately.
1. Retrieve the delegated permissions defined by Microsoft graph in your tenant application.
106
+
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`
1.Carefully review the permissions that the application requires. If you agree with the list of permissions, grant the delegated permissions to the application by running the following request.
112
+
1.Grant the delegated permissions to the client enterprise application by running the following request.
## Grant admin consent for application permissions
139
133
140
-
In the following example you grant the Microsoft Graph 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 API of ID `7ea9e944-71ce-443d-811c-71e8047b557a`.
141
-
142
-
1. Get the object ID of the enterprise application to which you'll grant application permissions. In the following example, the application is Microsoft Graph, identified by ID `b0d9b9e3-0ecf-4bfd-8dab-9273dd055a94`.
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`.
143
135
144
-
1.Get the enterprise application to which you want to grant delegated permissions.
1. Retrieve the application permissions defined by Microsoft graph in your tenantapplication.
142
+
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`.
1.Carefully review the permissions that the application requires. If you agree with the list of permissions, grant the application permissions to the application by running the following request.
148
+
1.Grant the application permission (app role) to the client enterprise application by running the following request.
157
149
158
150
```powershell
159
151
$params = @{
@@ -174,24 +166,20 @@ Use [Graph Explorer](https://developer.microsoft.com/graph/graph-explorer) to gr
174
166
175
167
## Grant admin consent for delegated permissions
176
168
177
-
In the following example, the application is Microsoft Graph. The object ID of Microsoft Graph in the tenant is b0d9b9e3-0ecf-4bfd-8dab-9273dd055a94. The delegated permissions `User.Read.All` and `Group.Read.All` are identified by the globally unique IDs `a154be20-db9c-4678-8ab7-66f6cc099a59` and `5f8c59db-677d-491f-a6b8-5f174b11ec1d respectively`. The consentType is AllPrincipals, indicating that you're consenting on behalf of all users in the tenant.
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`.
178
172
179
173
> [!CAUTION]
180
174
> Be careful! Permissions granted programmatically are not subject to review or confirmation. They take effect immediately.
181
175
182
-
1. Get the object ID of the enterprise application to which you'll grant application permissions. In the following example, the application is Microsoft Graph, identified by ID `b0d9b9e3-0ecf-4bfd-8dab-9273dd055a94`.
183
-
184
-
```http
185
-
GET /servicePrincipals/b0d9b9e3-0ecf-4bfd-8dab-9273dd055a94
186
-
```
187
-
188
-
1. Retrieve the delegated permissions defined by Microsoft graph in your tenant application.
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`
189
177
190
178
```http
191
179
GET https://graph.microsoft.com/v1.0/servicePrincipals?$filter=displayName eq 'Microsoft Graph'&$select=id,displayName,appId,oauth2PermissionScopes
192
180
```
193
181
194
-
1.Carefully review the permissions that the application requires. If you agree with the list of permissions, grant the delegated permissions to the application by running the following request.
182
+
1.Grant the delegated permissions to the client enterprise application by running the following request.
195
183
196
184
```http
197
185
POST https://graph.microsoft.com/v1.0/oauth2PermissionGrants
@@ -211,19 +199,14 @@ In the following example, the application is Microsoft Graph. The object ID of M
211
199
```
212
200
## Grant admin consent for application permissions
213
201
214
-
In the following example you grant the Microsoft Graph 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 API of ID `7ea9e944-71ce-443d-811c-71e8047b557a`.
215
-
216
-
1. Get the object ID of the enterprise application to which you'll grant application permissions. In the following example, the application is Microsoft Graph, identified by ID `b0d9b9e3-0ecf-4bfd-8dab-9273dd055a94`.
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`.
217
203
218
-
```http
219
-
GET /servicePrincipals/b0d9b9e3-0ecf-4bfd-8dab-9273dd055a94
220
-
```
221
-
1. Retrieve the application permissions defined by Microsoft graph in your tenant application.
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`
222
205
223
206
```http
224
207
GET https://graph.microsoft.com/v1.0/servicePrincipals?$filter=displayName eq 'Microsoft Graph'&$select=id,displayName,appId,appRoles
225
208
```
226
-
1.Carefully review the permissions that the application requires. If you agree with the list of permissions, grant the application permissions to the application by running the following request.
209
+
1.Grant the application permission (app role) to the client enterprise application by running the following request.
227
210
228
211
```http
229
212
POST https://graph.microsoft.com/v1.0/servicePrincipals/7ea9e944-71ce-443d-811c-71e8047b557a/appRoleAssignedTo
0 commit comments