I was trying to add some permissions to the (new) SPFx app. This is done using the New-MgOauth2PermissionGrant cmdlet. All examples shows using it with -BodyParameter :
1 2 3 4 5 6 7 |
$params = @{ "clientId" = $sPFxSP.id "ConsentType" = "AllPrincipals" "ResourceId" = $resourceSP.id "scope" = $scope } New-MgOauth2PermissionGrant -BodyParameter $params |
But this did not work for me. All I got back was an error
New-MgOauth2PermissionGrant : Missing property: clientId
I got it working by passing each property by itself instead:
1 |
New-MgOauth2PermissionGrant -ClientId $spfx.id -ConsentType "AllPrincipals" -ResourceId $resource.id -Scope $scope |