Can i use PnP core sdk inside .net 8.0 console application and use AD App registration which uses self-signed certificate #1382
Replies: 5 comments 5 replies
-
Assuming you have an X509Certificate2 object loaded from a file or embedded resource etc., you can just pass a X509CertificateAuthenticationProvider to PnpContextFactory.CreateAsync(). |
Beta Was this translation helpful? Give feedback.
-
Just pass the X509CertificateAuthenticationProvider directly to CreateAsync( ), 2nd argument. I don't think you need an AuthenticationProviderFactory. I'm using a .NET Core API setup with DI etc. so it's slightly different, but I can't see why that wouldn't work. |
Beta Was this translation helpful? Give feedback.
-
It's literally the 2nd parameter: |
Beta Was this translation helpful? Give feedback.
-
You're not, that's just the definition of CreateAsync. You just need to pass your authentication provider as the second parameter after the url.
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: mvcsharepointdev ***@***.***>
Sent: Wednesday, February 7, 2024 8:56:29 PM
To: pnp/pnpcore ***@***.***>
Cc: wizofaus ***@***.***>; Mention ***@***.***>
Subject: Re: [pnp/pnpcore] Can i use PnP core sdk inside .net 8.0 console application and use AD App registration which uses self-signed certificate (Discussion #1382)
@wizofaus<https://github.com/wizofaus> i am really getting confised, can you post a completed code, as i am not sure how to fit this code:-
public Task<PnPContext> CreateAsync(Uri url, IAuthenticationProvider authenticationProvider, PnPContextOptions options = null);
inside my original code? Thanks
—
Reply to this email directly, view it on GitHub<#1382 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABI5UAJH5HD62RWLEYC2G23YSNFU3AVCNFSM6AAAAABC3DE64WVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DGOJTGIYTK>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
@mvcsharepointdev : see https://github.com/pnp/pnpcore/blob/dev/docs/polyglot/Getting%20started%20-%20application%20permissions.ipynb |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have create a AD app registration which uses self-signed certificate for authentication. and i grant the AD app registration full control on SharePoint and graph APIs.
now i want to build a .net 8.0 console application which run on schedule bases .. so can i use PnP core SDK with AD app that uses self-signed certificate ? if this is possible, then is there a sample code that can help me?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions