You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
token acquisition for Client App will fail because confidentialClientApplication has not been built
Steps to reproduce
services.AddPnPCore(options =>
{
//var defProvider = new X509CertificateAuthenticationProvider(LoggerFactory.Create((b) => { }).CreateLogger<OAuthAuthenticationProvider>(), new SimpleHttpClientFactory());
//defProvider.TenantId = tenantId;
//defProvider.ClientId = clientId;
//defProvider.Certificate = GetCertificateFromStore(certThumbprint);
//this will not work to acquire token
//options.DefaultAuthenticationProvider = defProvider;
options.DefaultAuthenticationProvider = new X509CertificateAuthenticationProvider(clientId, tenantId, GetCertificateFromStore(certThumbprint)); //does not work behind a corporate proxy as IMsalHttpClientFactory is always null
});
Expected behavior
Expected behavior is to be able to initialize this provider with IMsalHttpClientFactory, reasoning being behind a corporate proxy, I need to specify custom HttpClientHandler (with Proxy).
I was not able to find a suitable constructor for X509CertificateAuthenticationProvider so that I can provide certificate, tenantId, clientId, and a custom IMsalHttpClientFactory. Maybe I am doing something wrong.
Workaround is to of course create your own implementation of OAuthAuthenticationProvider
Thanks for your contribution! Sharing is caring.
The text was updated successfully, but these errors were encountered:
@SPWizard01 : so you're unblocked at the moment? We've currently no bandwidth to bring full proxy configuration options to PnP Core, but we welcome a PR
Category
Describe the bug
When using this overload
pnpcore/src/sdk/PnP.Core.Auth/Confidential/X509CertificateAuthenticationProvider.cs
Line 89 in dc8dd2d
confidentialClientApplication
has not been builtSteps to reproduce
Expected behavior
Expected behavior is to be able to initialize this provider with IMsalHttpClientFactory, reasoning being behind a corporate proxy, I need to specify custom HttpClientHandler (with Proxy).
Environment details (development & target environment)
Additional context
I was not able to find a suitable constructor for X509CertificateAuthenticationProvider so that I can provide certificate, tenantId, clientId, and a custom IMsalHttpClientFactory. Maybe I am doing something wrong.
Workaround is to of course create your own implementation of
OAuthAuthenticationProvider
Thanks for your contribution! Sharing is caring.
The text was updated successfully, but these errors were encountered: