ApplyProvisioningTemplate not working with app based certificate authentication using C#
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start with AuthenticationManager.GetContext and web.ApplyProvisioningTemplate using the certificate-based setup shown. Trace the ClientContextSettings cast between PnP.Framework.Utilities.Context and OfficeDevPnP.Core.Utilities.Context, then reproduce the XML template flow with XMLFileSystemTemplateProvider. Done when app-only certificate authentication applies the template without the cast error.
Written by the indexing model from the issue text.
Description
We are trying to apply pnp provisioning template using pnp.framework app only based authentication. As per the documentation, this can be only achieved using basic authentication using username and password.
code
PnP.Framework.AuthenticationManager("", cert, "", null, PnP.Framework.AzureEnvironment.Production, null).GetContext("");
XMLTemplateProvider sitesProvider = new XMLFileSystemTemplateProvider("", "");
ProvisioningTemplate template = sitesProvider.GetTemplate("");
web.ApplyProvisioningTemplate(template);
Error:
Unable to cast object of type 'PnP.Framework.Utilities.Context.ClientContextSettings' to type 'OfficeDevPnP.Core.Utilities.Context.ClientContextSettings'.
- Dominant language
- C#
- Stars
- 259
- Forks
- 161
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pnp/pnpframework
-
area: provisioning ⚙
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
pnp/pnpframework#1274 ·
-
area: provisioning ⚙
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pnp/pnpframework#1269 ·
-
area: provisioning ⚙
Difficulty 1/5 Under an hour Newbie friendliness 72/100
pnp/pnpframework#1170 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
pnp/pnpframework#913 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
pnp/pnpframework#1283 ·
All issues in pnp/pnpframework
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100