<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z0000AFpFIaCQNOkta Classic EngineSingle Sign-OnAnswered2024-10-01T07:47:11.000Z2024-09-06T06:12:10.000Z2024-10-01T07:47:11.000Z

ShreeL.37354 (Customer) asked a question.

400 Bad Request Your request resulted in an error. Bad SAML request

When trying SSO with custom SP applicaton I get the below error.

ERROR:

400

Bad Request

Your request resulted in an error. Bad SAML request

Error: Bad SAML request

Why does this error occur and how to solve this? I have attached the SAML Request and also the SSO URL below.

SAML Request:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<saml2p:AuthnRequest

xmlns:saml2p=“urn:oasis:names:tc:SAML:2.0:protocol”

AssertionConsumerServiceURL=“http://localhost:8080/TestApp/ACS”

Destination=“https://**SSO_URI**/sso/saml”

ForceAuthn=“false”

ID=“a6c967da-2253-418b-bf25-53c90f50af7d”

IsPassive=“false”

IssueInstant=“2024-08-29T17:47:01.529996”

ProtocolBinding=“urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST”

ProviderName=“TestApp”

Version=“2.0”>

<saml2:Issuer

xmlns:saml2=“urn:oasis:names:tc:SAML:2.0:assertion”>http://localhost:8080/saml-service-provider-test

</saml2:Issuer>

</saml2p:AuthnRequest>

SSO URL:

https://**SSO_URI**/sso/saml?SAMLRequest=fVJdb5swFP0r1n13MG4IYIVUrF23Su0WNXSvlWOcBRVswjWoP3%2BGEC2Tpj5a956Pe47Xtx9NTQbdYWVNBuGCAdFG2bIyvzN4LR5oAgSdNKWsrdEZGAu3mzXKpuatyHt3NC%2F61Gt0xBMZFOdJBn1nhJVYoTCy0SicErv8%2BUnwBRNtZ51VtgaSI%2BrOeek7a7BvdLfT3VAp%2FfrylMHRuVYEQW2VrI8WnUhYwoLCa%2BVtG%2BR3OyD3%2FlEZ6Sbz4z56QKkHmvKEpUsWLuy7kwtlm0B6zPXkbXSKZzlvaKhK78TTvYWB%2FniP%2B1Bx6ezzt5M5fY3KOEC0wQgB8mA7pafTMzhIzwHk8T4DuVLpKi4l5Ty6ocsw2dP9gUc0ulEpO0RMHuLSb%2BJWIlaD%2FotF7PWjGUN2GXDGl5QllKdFGItlLPwNEU%2FTdAVkO%2Bf2pTLnfj4LeX9eQvG9KLZ0%2B3NXTATTnT%2F8dgZzkkB%2BXer3OJjLFZOt7rrVz%2FXkpUrY%2FL%2B4kYPOgdNL4nSMfB1cS27m57%2Ffa%2FMH&RelayState=http%3A%2F%2Flocalhost%3A8080%2FTestApp%2FACS

In the above request the SAML XML is deflated, Base64 encoded, and url encoded.


  • Paul S. (Okta, Inc.)

    Hello @ShreeL.37354 (Customer)​ Thank you for posting on our Community page!

     

    This usually indicates a miss-configuration in the implementation, I would recommend to review the settings on both sides, please also see our doc on this matter below:

    https://support.okta.com/help/s/article/400-bad-request-error-code-general-nonsuccess-received-when-attempting-login-with-saml-idp?language=en_US

     

    Thank you for reaching out to our Community and have a great day!

    --

    Help others in the community by liking or hitting Select as Best if this response helped you.

    Expand Post
  • ShreeL.37354 (Customer)

    SSO logsI also checked the logs and it shows "Reason Sign-on policy evaluation resulted in AUTHENTICATED Result ALLOW". There is no such thing as failure, warning or issue found in the logs. But still the above mentioned error page is shown.

    • Paul S. (Okta, Inc.)

      Hello @ShreeL.37354 (Customer)​  In this case I would recommend to open up a case with Support so they can provide additional assistance and to review the logs from the back-end to spot what is causing the failure.

      • ShreeL.37354 (Customer)

        Actually it works when using app embed link for SSO. But I could like to know why the actual SSO link doesn't work?

         

        It shows "You Do Not Have Access to Create a Case" when I try to open a case.

This question is closed.
Loading
400 Bad Request Your request resulted in an error. Bad SAML request
Okta Support Agent (Beta)

Terms of Service

Hello! I'm the Okta Support Agent (Beta), your go-to resource for questions about Okta products. Please remember for your security and privacy, do not share any Personally Identifiable Information (PII) such as passwords, IP addresses, or other details with me.

Okta Privacy Policy and Terms of Service apply