Azure SSO - Response status code does not indicate success: 426 (InvalidRequest).

Denny Luo 15 Reputation points
2023-05-31T18:31:46.07+00:00
Server Error in '/azuressotest' Application.
Response status code does not indicate success: 426 (InvalidRequest).
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Http.HttpRequestException: Response status code does not indicate success: 426 (InvalidRequest).
Azure SSO,OpenId, Authentication,Account sign, MS login
Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[HttpRequestException: Response status code does not indicate success: 426 (InvalidRequest).]
   System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() +121834
   Microsoft.IdentityModel.Protocols.<GetDocumentAsync>d__0.MoveNext() +399

[IOException: Unable to get document from: https://login.microsoftonline.com/******5/federationmetadata/2007-06/federationmetadata.xml?appid=****]
   Microsoft.IdentityModel.Protocols.<GetDocumentAsync>d__0.MoveNext() +725
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
   Microsoft.IdentityModel.Protocols.<GetAsync>d__1.MoveNext() +414
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
   Microsoft.IdentityModel.Protocols.<GetConfigurationAsync>d__3.MoveNext() +908

[InvalidOperationException: IDX10803: Unable to create to obtain configuration from: 'https://login.microsoftonline.com/1426******/federationmetadata/2007-06/federationmetadata.xml?appid=d91b1af3*****.]
   Microsoft.IdentityModel.Protocols.<GetConfigurationAsync>d__3.MoveNext() +1255
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
   Microsoft.Owin.Security.WsFederation.<ApplyResponseChallengeAsync>d__c.MoveNext() +522
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
   Microsoft.Owin.Security.Infrastructure.<ApplyResponseCoreAsync>d__8.MoveNext() +376
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
   Microsoft.Owin.Security.Infrastructure.<TeardownAsync>d__5.MoveNext() +215
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
   Microsoft.Owin.Security.Infrastructure.<Invoke>d__0.MoveNext() +968
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
   Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.<RunApp>d__5.MoveNext() +197
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
   Microsoft.Owin.Security.Infrastructure.<Invoke>d__0.MoveNext() +768
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
   Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.<RunApp>d__5.MoveNext() +197
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
   Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.<DoFinalWork>d__2.MoveNext() +184
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
   Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar) +117
   System.Web.AsyncEventExecutionStep.InvokeEndHandler(IAsyncResult ar) +209
   System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +156

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3930.0

Microsoft Security Microsoft Entra Microsoft Entra ID
Microsoft Security Microsoft Authenticator
{count} votes

4 answers

Sort by: Most helpful
  1. Denny Luo 15 Reputation points
    2023-05-31T22:28:03.33+00:00

    I finally figured out solution

    I explicitly only allowing TLS1.2 for MS login

    so that Web server don't have to change their security setting as long as it has TLS1.2 enable on their Windows Servers

    1 person found this answer helpful.

  2. Denny Luo 15 Reputation points
    2023-05-31T18:41:38.01+00:00

    additionally, this same solution works well for one client (different Windows server - 2012)

    have above error for all other clients (Windows Server 2019)

    Not sure it's network issue or Windows server security setting issue

    Can anybody give suggestion what change is required

    thank you so much

    Denny

    0 comments No comments

  3. Anand Prakash-Dubey (Azure Admin) 0 Reputation points
    2023-06-07T14:22:44.6833333+00:00

    Hi,

    I am getting the same error, earlier it was working properly but after 31 May 2023 , It stopped working. Do we have any logs or any track what changed or how to fix it ?


  4. Himesh Patel 0 Reputation points
    2023-06-08T09:07:17.1333333+00:00

    We have run into this yesterday. Appears TLS 1.1 is no longer accepted by federation meta data url. You must use TLS 1.2

    Ie. add the following to your code (this allows backward compatibility with 1.1)

    System.Net.ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.