Skip to content

Commit 1c29fb6

Browse files
authored
Merge pull request #4536 from KoenZomers/ExcludeCredentialLoginFromPermissionCheck
Excluding permission check when logged on using credentials
2 parents 4d7f15f + baf129b commit 1c29fb6

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)