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: microsoftgraph/docs-conceptual/tutorial-grant-app-only-api-permissions.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
---
2
2
title: "Grant application permissions programmatically in Azure AD"
3
-
description: "Learn how to grant app-only permissions programmatically in Azure AD using Microsoft Graph PowerShell"
3
+
description: "Learn how to grant and revoke app-only permissions programmatically in Azure AD using Microsoft Graph PowerShell"
4
4
ms.topic: tutorial
5
-
ms.date: 12/07/2022
5
+
ms.date: 03/17/2022
6
6
author: msewaweru
7
7
manager: CelesteDG
8
8
ms.author: eunicewaweru
9
9
ms.reviewer: jawoods, phsignor
10
10
---
11
11
12
-
# Tutorial: Grant app roles in Azure AD
12
+
# Tutorial: Grant and revoke app roles in Azure AD
13
13
14
14
When you grant API permissions to a client app in Azure AD, the permission grants are recorded as objects that can be accessed, updated, or deleted like other objects. Using Microsoft Graph PowerShell cmdlets to directly create permission grants is a programmatic alternative to [interactive consent](/azure/active-directory/manage-apps/consent-and-permissions-overview). This can be useful for automation scenarios, bulk management, or other custom operations in your organization.
15
15
@@ -24,7 +24,7 @@ To successfully complete this tutorial, make sure you have the required prerequi
24
24
25
25
1. A working Azure AD tenant.
26
26
1. Microsoft Graph PowerShell SDK is installed. Follow the [Install the Microsoft Graph PowerShell SDK](installation.md) guide to install the SDK.
27
-
1. Microsoft Graph PowerShell using a global administrator role and the appropriate permissions. For this tutorial, the `Application.Read.All` and `AppRoleAssignment.ReadWrite.All` delegated permissions are required. To set the permissions in Microsoft Graph PowerShell, run:
27
+
1. Microsoft Graph PowerShell using a user with privileges to create applications in the tenant and the appropriate permissions. For this tutorial, the `Application.Read.All` and `AppRoleAssignment.ReadWrite.All` delegated permissions are required. To set the permissions in Microsoft Graph PowerShell, run:
## Step 3: Assign an app role to the client service principal
104
+
## Step 3: Assign an app role to the client enterprise application
105
105
106
106
In this step, you'll assign an app role exposed by your resource app to the service principal we created in step 2. To create an app role assignment, you'll need the following information:
-[Tutorial: Grant delegated permissions programmatically in Azure AD](tutorial-grant-delegated-api-permissions.md)
146
+
-[Grant or revoke API permissions using Microsoft Graph](/graph/permissions-grant-via-msgraph?branch=pr-en-us-20614&tabs=http&pivots=grant-application-permissions)
Copy file name to clipboardExpand all lines: microsoftgraph/docs-conceptual/tutorial-grant-delegated-api-permissions.md
+42-12Lines changed: 42 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,30 +1,30 @@
1
1
---
2
-
title: "Grant delegated permissions programmatically in Azure AD"
3
-
description: "Learn how to grant delegated permissions programmatically in Azure AD using Microsoft Graph PowerShell"
2
+
title: "Grant and revoke delegated permissions programmatically in Azure AD"
3
+
description: "Learn how to grant and revoke delegated permissions programmatically in Azure AD using Microsoft Graph PowerShell"
4
4
ms.topic: tutorial
5
-
ms.date: 12/07/2022
5
+
ms.date: 03/17/2023
6
6
author: msewaweru
7
7
manager: CelesteDG
8
8
ms.author: eunicewaweru
9
9
ms.reviewer: jawoods, phsignor
10
10
---
11
11
12
-
# Tutorial: Grant delegated permissions in Azure AD
12
+
# Tutorial: Grant and revoke delegated permissions in Azure AD
13
13
14
14
When you grant API permissions to a client app in Azure AD, the permission grants are recorded as objects that can be accessed, updated, or deleted like other objects. Using Microsoft Graph PowerShell cmdlets to directly create permission grants is a programmatic alternative to [interactive consent](/azure/active-directory/manage-apps/consent-and-permissions-overview). This can be useful for automation scenarios, bulk management, or other custom operations in your organization.
15
15
16
16
>[!Caution]
17
17
>Be Careful! Permissions created programmatically are not subject to review or confirmation. They take effect immediately.
18
18
19
-
In this tutorial, you'll grant delegated permissions that are exposed by an API to an app. Delegated permissions, also called scopes or OAuth2 permissions, allow an app to call an API on behalf of a signed-in user.
19
+
In this tutorial, you'll grant and revoke delegated permissions that are exposed by an API to an app. Delegated permissions, also called scopes or OAuth2 permissions, allow an app to call an API on behalf of a signed-in user.
20
20
21
21
## Prerequisites
22
22
23
23
To successfully complete this tutorial, make sure you have the required prerequisites:
24
24
25
25
1. A working Azure AD tenant.
26
26
1. Microsoft Graph PowerShell SDK is installed. Follow the [Install the Microsoft Graph PowerShell SDK](installation.md) guide to install the SDK.
27
-
1. Microsoft Graph PowerShell using a global administrator role and the appropriate permissions. For this tutorial, the `Application.Read.All` and `DelegatedPermissionGrant.ReadWrite.All` delegated permissions are required. To set the permissions in Microsoft Graph PowerShell, run:
27
+
1. Microsoft Graph PowerShell using a user with privileges to create applications in the tenant and the appropriate permissions. For this tutorial, the `Application.Read.All` and `DelegatedPermissionGrant.ReadWrite.All` delegated permissions are required. To set the permissions in Microsoft Graph PowerShell, run:
@@ -35,7 +35,7 @@ To successfully complete this tutorial, make sure you have the required prerequi
35
35
36
36
## Step 1: Get the delegated permissions of the resource service principal
37
37
38
-
Before you can grant delegated permissions, you must first identify the delegated permissions to grant and the resource service principal that exposes the delegated permissions. Delegated permissions are defined in the `oauth2PermissionScopes` object of a service principal.
38
+
Before you can grant delegated permissions, you must first identify the delegated permissions to grant and the resource service principal that exposes the delegated permissions. Delegated permissions are defined in the `oauth2PermissionScopes` object of a service principal.
39
39
40
40
In this article, you'll use the `Microsoft Graph` service principal in the tenant as your resource service principal.
### Step 5: Revoke delegated permissions granted to an enterprise application
173
+
174
+
If a service principal has been granted multiple delegated permission grants, you can choose to revok either specific gants or all grants.
175
+
176
+
- To revoke one or more grants, update oauthPermissionGrant object and specify only the delegated permissions to retain in the **scope** parameter. For example, to revoke the `User.read.All` permission, run:
When a delegated permission grant is deleted, the access it granted is revoked. Existing access tokens will continue to be valid for their lifetime, but new access tokens will not be granted for the delegated permissions identified in the deleted oAuth2PermissionGrant.
164
193
165
194
## See also
166
195
167
196
-[Tutorial: Grant application permissions programmatically in Azure AD](tutorial-grant-app-only-api-permissions.md)
197
+
-[Grant or revoke API permissions using Microsoft Graph](/graph/permissions-grant-via-msgraph?tabs=http&pivots=grant-delegated-permissions)
0 commit comments