I'm trying to interact with an Azure Blob Storage protected by Azure AD using ClientID & ClientSecret. It's working fine when I'm running the application from my machine on Visual Studio however when I run it from a VM on-premise, I'm getting this error:
An error response was returned by the OAuth2 server, but it could not be parsed. Please inspect the exception properties for details. ---> MSAL.NetCore.4.30.1.0.MsalServiceException: ErrorCode: non_parsable_oauth_error Microsoft.Identity.Client.MsalServiceException: An error response was returned by the OAuth2 server, but it could not be parsed. Please inspect the exception properties for details. at Microsoft.Identity.Client.Internal.Requests.RequestBase.HandleTokenRefreshError(MsalServiceException e, MsalAccessTokenCacheItem cachedAccessTokenItem) at Microsoft.Identity.Client.Internal.Requests.ClientCredentialRequest.ExecuteAsync(CancellationToken cancellationToken) at Microsoft.Identity.Client.Internal.Requests.RequestBase.RunAsync(CancellationToken cancellationToken) at Microsoft.Identity.Client.ApiConfig.Executors.ConfidentialClientExecutor.ExecuteAsync(AcquireTokenCommonParameters commonParameters, AcquireTokenForClientParameters clientParameters, CancellationToken cancellationToken) at Azure.Identity.AbstractAcquireTokenParameterBuilderExtensions.ExecuteAsync[T](AbstractAcquireTokenParameterBuilder`1 builder, Boolean async, CancellationToken cancellationToken) at Azure.Identity.MsalConfidentialClient.AcquireTokenForClientAsync(String[] scopes, Boolean async, CancellationToken cancellationToken) at Azure.Identity.ClientSecretCredential.GetTokenAsync(TokenRequestContext req uestContext, CancellationToken cancellationToken) StatusCode: 407
Looks like you are going through a proxy to access the Oauth endpoint
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/407
The
HTTP 407 Proxy Authentication Required
client error status response code indicates that the request has not been applied because it lacks valid authentication credentials for a proxy server that is between the browser and the server that can access the requested resource.
You need to inspect the connectivity properties between the VM and the OAuth server
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.