Table of Contents

Interface IServicePrincipal

Namespace
PnP.Core.Admin.Model.SharePoint
Assembly
PnP.Core.Admin.dll

Manage the SharePoint apps service principal

public interface IServicePrincipal

Methods

AddGrant(string, string, VanityUrlOptions)

Grants a Permission

[Obsolete("Use AddGrant2 instead")]
IPermissionGrant AddGrant(string resource, string scope, VanityUrlOptions vanityUrlOptions = null)

Parameters

resource string

Resource of the permission

scope string

Scope of the permission

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

IPermissionGrant

the new permission grant

AddGrant2(string, string, VanityUrlOptions)

Grants scope on a resource

IPermissionGrant2 AddGrant2(string resource, string scope, VanityUrlOptions vanityUrlOptions = null)

Parameters

resource string

The name of the resource, e.g. Microsoft Graph

scope string

The scope to grant, e.g. 'User.ReadBasic.All'

vanityUrlOptions VanityUrlOptions

Returns

IPermissionGrant2

The resulting IPermissionGrant2

AddGrant2Async(string, string, VanityUrlOptions)

Grants scope on a resource

Task<IPermissionGrant2> AddGrant2Async(string resource, string scope, VanityUrlOptions vanityUrlOptions = null)

Parameters

resource string

The name of the resource, e.g. Microsoft Graph

scope string

The scope to grant, e.g. 'User.ReadBasic.All'

vanityUrlOptions VanityUrlOptions

Returns

Task<IPermissionGrant2>

The resulting IPermissionGrant2

AddGrantAsync(string, string, VanityUrlOptions)

Grants a Permission

[Obsolete("Use AddGrant2Async instead")]
Task<IPermissionGrant> AddGrantAsync(string resource, string scope, VanityUrlOptions vanityUrlOptions = null)

Parameters

resource string

Resource of the permission

scope string

Scope of the permission

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<IPermissionGrant>

the new permission grant

ApprovePermissionRequest(string, VanityUrlOptions)

Approves the specified permission request

[Obsolete("Use IApp.ApprovePermissionRequests instead")]
IPermissionGrant ApprovePermissionRequest(string id, VanityUrlOptions vanityUrlOptions = null)

Parameters

id string

permission request id

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

IPermissionGrant

permission grant

ApprovePermissionRequestAsync(string, VanityUrlOptions)

Approves the specified permission request

[Obsolete("Use IApp.ApprovePermissionRequestsAsync instead")]
Task<IPermissionGrant> ApprovePermissionRequestAsync(string id, VanityUrlOptions vanityUrlOptions = null)

Parameters

id string

permission request id

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<IPermissionGrant>

permission grant

DeleteGrant2(string, VanityUrlOptions)

Deletes the whole grant with all scopes.

void DeleteGrant2(string grantId, VanityUrlOptions vanityUrlOptions = null)

Parameters

grantId string

The id of the grant

vanityUrlOptions VanityUrlOptions

DeleteGrant2Async(string, VanityUrlOptions)

Deletes the whole grant with all scopes.

Task DeleteGrant2Async(string grantId, VanityUrlOptions vanityUrlOptions = null)

Parameters

grantId string

The id of the grant

vanityUrlOptions VanityUrlOptions

Returns

Task

void

DenyPermissionRequest(string, VanityUrlOptions)

Denies the specified permission request

[Obsolete("Use RevokeGrant2 instead")]
void DenyPermissionRequest(string id, VanityUrlOptions vanityUrlOptions = null)

Parameters

id string

permission request id

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

DenyPermissionRequestAsync(string, VanityUrlOptions)

Denies the specified permission request

[Obsolete("Use RevokeGrant2Async instead")]
Task DenyPermissionRequestAsync(string id, VanityUrlOptions vanityUrlOptions = null)

Parameters

id string

permission request id

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task

Disable(VanityUrlOptions)

Disable the Service Principal

[Obsolete("Use Disable2 instead")]
IServicePrincipalProperties Disable(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

IServicePrincipalProperties

the list of permission requests

Disable2(VanityUrlOptions)

Disable the Service Principal

IServicePrincipalProperties Disable2(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

IServicePrincipalProperties

the list of permission requests

Disable2Async(VanityUrlOptions)

Disable the Service Principal

Task<IServicePrincipalProperties> Disable2Async(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<IServicePrincipalProperties>

the list of permission requests

DisableAsync(VanityUrlOptions)

Disable the Service Principal

[Obsolete("Use Disable2Async instead")]
Task<IServicePrincipalProperties> DisableAsync(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<IServicePrincipalProperties>

the list of permission requests

Enable(VanityUrlOptions)

Enable the Service Principal

[Obsolete("Use Enable2 instead")]
IServicePrincipalProperties Enable(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

IServicePrincipalProperties

the list of permission requests

Enable2(VanityUrlOptions)

Enable the Service Principal

IServicePrincipalProperties Enable2(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

IServicePrincipalProperties

the list of permission requests

Enable2Async(VanityUrlOptions)

Enable the Service Principal

Task<IServicePrincipalProperties> Enable2Async(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<IServicePrincipalProperties>

the list of permission requests

EnableAsync(VanityUrlOptions)

Enable the Service Principal

[Obsolete("Use Enable2Async instead")]
Task<IServicePrincipalProperties> EnableAsync(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<IServicePrincipalProperties>

the list of permission requests

GetPermissionRequests(VanityUrlOptions)

Lists pending permission requests

[Obsolete("Use ListGrants2 instead")]
List<IPermissionRequest> GetPermissionRequests(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

List<IPermissionRequest>

the list of permission requests

GetPermissionRequestsAsync(VanityUrlOptions)

Lists pending permission requests

[Obsolete("Use ListGrants2Async instead")]
Task<List<IPermissionRequest>> GetPermissionRequestsAsync(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<List<IPermissionRequest>>

the list of permission requests

ListGrants(VanityUrlOptions)

Lists all granted Permissions

[Obsolete("Use ListGrants2 instead")]
IEnumerable<IPermissionGrant> ListGrants(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

IEnumerable<IPermissionGrant>

the list of granted permissions

ListGrants2(VanityUrlOptions)

Get all granted permissions of the SharePoint Online Client Extensibility Web Application Principal

IPermissionGrant2[] ListGrants2(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

IPermissionGrant2[]

The list of granted OAuth2 permissions

ListGrants2Async(VanityUrlOptions)

Get all granted permissions of the SharePoint Online Client Extensibility Web Application Principal

Task<IPermissionGrant2[]> ListGrants2Async(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<IPermissionGrant2[]>

The list of granted OAuth2 permissions

ListGrantsAsync(VanityUrlOptions)

Lists all granted Permissions

[Obsolete("Use ListGrants2Async instead")]
Task<IEnumerable<IPermissionGrant>> ListGrantsAsync(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<IEnumerable<IPermissionGrant>>

the list of granted permissions

RevokeGrant(string, VanityUrlOptions)

Revokes a Permission

[Obsolete("Use RevokeGrant2 instead")]
IPermissionGrant RevokeGrant(string objectId, VanityUrlOptions vanityUrlOptions = null)

Parameters

objectId string

Object Id of the permission

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

IPermissionGrant

the revoked permission grant

RevokeGrant2(string, string, VanityUrlOptions)

Removed a scope from an existing grant

IPermissionGrant2 RevokeGrant2(string grantId, string scope, VanityUrlOptions vanityUrlOptions = null)

Parameters

grantId string

The id of the grant

scope string

The scope to remove from the grant denoted by grantId

vanityUrlOptions VanityUrlOptions

Returns

IPermissionGrant2

The updated IPermissionGrant2, or null if the last scope was removed from the grant

RevokeGrant2Async(string, string, VanityUrlOptions)

Removed a scope from an existing grant

Task<IPermissionGrant2> RevokeGrant2Async(string grantId, string scope, VanityUrlOptions vanityUrlOptions = null)

Parameters

grantId string

The id of the grant

scope string

The scope to remove from the grant denoted by grantId

vanityUrlOptions VanityUrlOptions

Returns

Task<IPermissionGrant2>

The updated IPermissionGrant2, or null if the last scope was removed from the grant

RevokeGrantAsync(string, VanityUrlOptions)

Revokes a Permission

[Obsolete("Use RevokeGrant2Async instead")]
Task<IPermissionGrant> RevokeGrantAsync(string objectId, VanityUrlOptions vanityUrlOptions = null)

Parameters

objectId string

Object Id of the permission

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<IPermissionGrant>

the revoked permission grant