Skip to content

Commit baf129b

Browse files
committed
Excluding permission check when logged on using credentials
1 parent f3c79fd commit baf129b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Commands/Base/PnPSharePointCmdlet.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,12 @@ protected override void ProcessRecord()
120120

121121
WriteVerbose("Making call to SharePoint Online using the Client Side Object Model (CSOM)");
122122

123-
// Validate the permissions in the access token for SharePoint Online
124-
TokenHandler.EnsureRequiredPermissionsAvailableInAccessTokenAudience(this, AccessToken);
123+
// Client Credentials based connections do not have an access token, so we can't validate permissions
124+
if(Connection.ConnectionMethod != ConnectionMethod.Credentials)
125+
{
126+
// Validate the permissions in the access token for SharePoint Online
127+
TokenHandler.EnsureRequiredPermissionsAvailableInAccessTokenAudience(this, AccessToken);
128+
}
125129

126130
base.ProcessRecord();
127131
}

0 commit comments

Comments
 (0)