forked from pnp/cli-microsoft365
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the 'aad oauth2grant list' command solving pnp#159
- Loading branch information
1 parent
35058db
commit 77f24ef
Showing
6 changed files
with
560 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# aad oauth2grant list | ||
|
||
Lists OAuth2 permission grants for the specified service principal | ||
|
||
## Usage | ||
|
||
```sh | ||
aad oauth2grant list [options] | ||
``` | ||
|
||
## Options | ||
|
||
Option|Description | ||
------|----------- | ||
`--help`|output usage information | ||
`-i, --clientId <clientId>`|objectId of the service principal for which the configured OAuth2 permission grants should be retrieved | ||
`-o, --output <output>`|Output type. `json|text`. Default `text` | ||
`--verbose`|Runs command with verbose logging | ||
`--debug`|Runs command with debug logging | ||
|
||
!!! important | ||
Before using this command, connect to Azure Active Directory Graph, using the [aad connect](../connect.md) command. | ||
|
||
## Remarks | ||
|
||
To get information about service principal OAuth2 permission grants, you have to first connect to Azure Active Directory Graph using the [aad connect](../connect.md) command, eg. `aad connect`. | ||
|
||
In order to list existing OAuth2 permissions granted to a service principal, you need its `objectId`. You can retrieve it using the [aad sp get](../sp/sp-get.md) command. | ||
|
||
## Examples | ||
|
||
List OAuth2 permissions granted to service principal with `objectId` _b2307a39-e878-458b-bc90-03bc578531d6_. | ||
|
||
```sh | ||
aad oauth2grant list --clientId b2307a39-e878-458b-bc90-03bc578531d6 | ||
``` | ||
|
||
## More information | ||
|
||
- Application and service principal objects in Azure Active Directory (Azure AD): [https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/o365/aad/commands/oauth2grant/OAuth2PermissionGrant.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export interface OAuth2PermissionGrant { | ||
clientId: string; | ||
consentType: string; | ||
expiryTime: string; | ||
objectId: string; | ||
principalId: string; | ||
resourceId: string; | ||
scope: string; | ||
startTime: string; | ||
} |
Oops, something went wrong.