Replies: 1 comment 12 replies
-
Hi @gavdgavd , App-only authentication against SharePoint Online requires certificate based authentication for calling the "classic" SharePoint REST/CSOM APIs. The SharePoint Graph calls can work with clientid+secret, but since PnP Core SDK requires both type of APIs (as not all features are exposed via the Graph APIs) you need to use certificate based auth. See https://pnp.github.io/pnpcore/demos/README.html for our samples, the Authentication Type column in the tables shows the used auth provider and allows you to pick a relevant sample. |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Looking for help about the use of authentication in PnP Core SDK using the AD Client ID with a Secret.
Working to get data from SharePoint using the PnP Core SDK, I must use an Azure App Registration with Application rights (not Delegated rights); thus, I do have only the ClientID and the Secret.
The only way to authenticate using the PnP Core SDK with a secret seems to be using OnBehalfOfAuthenticationProvider. Unfortunately, the fourth parameter of OnBehalfOfAuthenticationProvider is a function that provides the OAuth bearer Token from Azure (the first three parameters are known: ClintId, TenantId, and Secret). But at the moment of creation of the Builder, the call hasn't made yet a trip to Azure, thus the Token is unknown. Additionally, I do not see the reason why the Token must be given as input parameter to ask for the Token again.
Tried to use ExternalAuthenticationProvider as well, giving the Token obtained through a direct call to Azure, but that is very convoluted, and I am getting the cryptic error "One or more errors occurred".
Any example and/or idea will be very appreciated. Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions