microsoftgraph / msgraph-sdk-dotnet-auth

Archived - use the TokenCredential classes provided by Azure.Identity. https://docs.microsoft.com/en-us/dotnet/api/overview/azure/identity-readme
https://graph.microsoft.com
MIT License
78 stars 19 forks source link

Add support for configuring a proxy #27

Closed peombwa closed 5 years ago

joshfriend commented 5 years ago
var handler = new HttpClientHandler {
  Proxy = new WebProxy("http://localhost:8888", false),
  UseProxy = true,
  ServerCertificateCustomValidationCallback = (message, certificate, chain, errors) => true
};
var httpProvider = new HttpProvider(handler, false, new Serializer());
var client = new GraphServiceClient(authenticationProvider, httpProvider);

DO NOT use this in production as it ignores certificate validation errors and opens you up to MiTM attacks. It's great for debugging though.

peombwa commented 5 years ago

MSAL now provides a mechanism to configure a proxy https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/httpclient