Skip to content

New command: add OAuth grant for the specified service principal #164

@waldekmastykarz

Description

@waldekmastykarz

Add OAuth grant for the specified service principal

  • command: aad oauthgrant add -i|--clientId <clientId> -r|--resourceId <resourceId> -s|--scope <scope>
  • clientId: ID of the service principal for which permissions should be granted
  • resourceId: ID of the resource for which permissions should be granted (eg. MS Graph)
  • scope: permissions to be granted
  • requires connection to AAD Graph

The information can be get from the following REST call:

POST https://graph.windows.net/myorganization/oauth2PermissionGrants?api-version=1.6
content-type: application/json
authorization: Bearer eyJ0eXAiOiJKV...

{
    "odata.type": "Microsoft.DirectoryServices.OAuth2PermissionGrant",
    "clientId": "<clientId>",
    "consentType": "AllPrincipals",
    "principalId": null,
    "resourceId": "<resourceId>",
    "scope": "<scope>",
    "startTime": "0001-01-01T00:00:00",
    "expiryTime": "9000-01-01T00:00:00"
}

If an OAuth grant for the specified clientId/resourceId pair already exists, the API call will return an error.

Requires #160 to be done first

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions