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-delegated-api-permissions.md
+40-11Lines changed: 40 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,22 @@
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/13/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
@@ -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.
0 commit comments