Response status code does not indicate success: 426 (InvalidRequest)

969 Views Asked by At

I am getting the issue on my deployed API's, earlier it was working properly but after 31 May 2023 on words we are getting status code 426 (InvalidRequest). And I'm not sure is that anything got changed on Microsoft authentication level. If yes, what changes we need to do on already deployed API's? Thanks.

[HttpRequestException: Response status code does not indicate success: 426 (InvalidRequest).]
System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() +210
Microsoft.Owin.Security.ActiveDirectory.WsFedMetadataRetriever.GetSigningKeys(String metadataEndpoint, TimeSpan backchannelTimeout, HttpMessageHandler backchannelHttpHandler) +160
Microsoft.Owin.Security.ActiveDirectory.WsFedCachingSecurityTokenProvider.RetrieveMetadata() +423 Microsoft.Owin.Security.ActiveDirectory.WsFedCachingSecurityTokenProvider..ctor(String metadataEndpoint, ICertificateValidator backchannelCertificateValidator, TimeSpan backchannelTimeout, HttpMessageHandler backchannelHttpHandler) +361
Owin.WindowsAzureActiveDirectoryBearerAuthenticationExtensions.UseWindowsAzureActiveDirectoryBearerAuthentication(IAppBuilder app, WindowsAzureActiveDirectoryBearerAuthenticationOptions options) +163 Startup.ConfigureAuth(IAppBuilder app) in C:\Code\Release\API\App_Start\Startup.Auth.cs:13
API.Startup.Configuration(IAppBuilder app) in C:\Code\Release\API\Startup.cs:9

Can somebody assist on this? Thanks.

1

There are 1 best solutions below

3
Pravallika KV On

Basically, the error code 426 (InvalidRequest) indicates that the Upgradation of software to the latest version is required which supports the latest authentication protocols.

  • It can also be because the deployed API is not compatible with the new protocols.
  • Check if your API is compatible with the latest authentication protocols.

As @flydog57 mentioned, I feel you need to upgrade/downgrade the TLS version of your API according to run the application without any issues.

To update TLS version:

Open your API=> Security=>Protocols + Ciphers: Select the TLS version according to your requirement=>Save.

By default, TLS version 1.2 is enabled for both Client and Backend protocols.

enter image description here

References: Manage protocols and ciphers in Azure API Management