Get a Certificate authenticated SharePoint context to run Context.Site.CreateSPAsyncReadJob()

Vish Pothaganti 26 Reputation points
2021-04-26T12:49:47.023+00:00

Hello,

I was able to successfully create a SPAsyncReadJob and get the manifest.xml file created on azure using the sample here https://gist.github.com/techmadness/484e7de0a7c51e5faf952a79f1eacb85

I then tried to get the context without UserName/Password and instead used a Certificate I uploaded to the same Azure application like this:
var clientContext = authenticationManager.GetAzureADAppOnlyAuthenticatedContext(SiteURL, ClientId, TenantId, Cert, AzureEnvironment.Production);

The context gets created fine but I get a 401 Unauthorized when trying to create the SPAsyncReadJob on the site.

Can you please advice how to get a authenticated context to create SPAsyncReadJob without using UserName/Password and only by using ClientID/ClientSecret/Certificate.

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments

1 answer

Sort by: Oldest
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    3 deleted comments

    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.