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
I recently ran into this issue with Token requests not going through the proxy. I was using the same code, with one exception: Instead of providing an instance of ClientSecretCredentialOptions to the ClientSecretCredential, I had a TokenCredentialOptions instance.
I was then getting a timeout every time I was trying to access any API method on a machine that only allowed internet access through a proxy - it was the login that was timing out. Netstat -a showed that a connection was attempted directly to login.microsoftonline.com, instead of through the proxy.
Because the code at first glance looked just like the code in the linked issue, I didn't even register that I was doing something different. It seems weird to me that TokenCredentialOptions has the same Transport property, but in that case, the proxy config is not heeded.
Expected behavior
I would have expected the request to get the token to also pass through the proxy I provided.
How to reproduce
Instantiate the GraphServiceClient as follows:
var proxy = GetWebProxy();
var handler = new HttpClientHandler
{
Proxy = proxy,
UseProxy = proxy != null
};
var options = new TokenCredentialOptions
{
AuthorityHost = AzureAuthorityHosts.AzurePublicCloud,
Transport = new HttpClientTransport(handler)
};
var credential = new ClientSecretCredential(config.TenantId, config.ClientId, config.ClientSecret, options);
var httpClient = GraphClientFactory.Create(proxy: proxy);
graphServiceClient = new GraphServiceClient(httpClient, new Microsoft.Kiota.Authentication.Azure.AzureIdentityAuthenticationProvider(credential));
SDK Version
5.60.0
Latest version known to work for scenario above?
No response
Known Workarounds
if I define options in the code above as follows, things work out just fine
var options = new ClientSecretCredentialOptions
{
Transport = new HttpClientTransport(handler)
};
Debug output
No response
Configuration
OS: Win11 Pro 23H2 64bit on .NET 8.0.10
Other information
No response
The text was updated successfully, but these errors were encountered:
The ClientSecretCredentialOptions and the TokenCredentialOptions are unfortunately not part of this library. But part of the Azure.Identity library which will handle the token acquisition.
Any chance you can create the issue at the link below so that the library authors can take a look into this? You may need to include the version of the Azure.Identity you are using as well.
Describe the bug
I recently ran into this issue with Token requests not going through the proxy. I was using the same code, with one exception: Instead of providing an instance of
ClientSecretCredentialOptions
to theClientSecretCredential
, I had aTokenCredentialOptions
instance.I was then getting a timeout every time I was trying to access any API method on a machine that only allowed internet access through a proxy - it was the login that was timing out.
Netstat -a
showed that a connection was attempted directly to login.microsoftonline.com, instead of through the proxy.Because the code at first glance looked just like the code in the linked issue, I didn't even register that I was doing something different. It seems weird to me that
TokenCredentialOptions
has the same Transport property, but in that case, the proxy config is not heeded.Expected behavior
I would have expected the request to get the token to also pass through the proxy I provided.
How to reproduce
Instantiate the GraphServiceClient as follows:
var proxy = GetWebProxy();
var handler = new HttpClientHandler
{
Proxy = proxy,
UseProxy = proxy != null
};
var options = new TokenCredentialOptions
{
AuthorityHost = AzureAuthorityHosts.AzurePublicCloud,
Transport = new HttpClientTransport(handler)
};
var credential = new ClientSecretCredential(config.TenantId, config.ClientId, config.ClientSecret, options);
var httpClient = GraphClientFactory.Create(proxy: proxy);
graphServiceClient = new GraphServiceClient(httpClient, new Microsoft.Kiota.Authentication.Azure.AzureIdentityAuthenticationProvider(credential));
SDK Version
5.60.0
Latest version known to work for scenario above?
No response
Known Workarounds
if I define
options
in the code above as follows, things work out just finevar options = new ClientSecretCredentialOptions
{
Transport = new HttpClientTransport(handler)
};
Debug output
No response
Configuration
OS: Win11 Pro 23H2 64bit on .NET 8.0.10
Other information
No response
The text was updated successfully, but these errors were encountered: