SAML SP Initiated login not working for Saas Application

Anil Kumar Agrawal 25 Reputation points
2023-10-03T12:33:14.83+00:00

I have integrated my application with Azure Active Directory. I am using Azure as IDP for my Saas application using SAML protocol. I am able to login in my application when initiating login through IDP. But login inited through my application (Service Provider) not working. I am receiving below error.

Error

Sorry, but we’re having trouble signing you in.

AADSTS7500525: There was an XML error in the SAML message at line 2, position 656. Verify that the XML content of the SAML messages conforms to the SAML protocol specifications.

Note : Same application is successfully integrated with other SAML IDPs like Okta, KeyCloak etc

Microsoft Security | Microsoft Entra | Microsoft Entra External ID
Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

Accepted answer
  1. Akhilesh Vallamkonda 15,320 Reputation points Microsoft External Staff Moderator
    2023-10-10T12:07:58.9733333+00:00

    Hi @Anil Kumar Agrawal

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others", I'll repost your solution in case you'd like to "Accept" the answer.

    Issue:

    In the process of application integration users is able to login with the application in initiating login through IDP. Though login initiated through application (Service Provider) getting following error

    Error:
    Sorry, but we’re having trouble signing you in. AADSTS7500525: There was an XML error in the SAML message at line 2, position 656. Verify that the XML content of the SAML messages conforms to the SAML protocol specifications.

    Solution

    To resolve the issue by removing the "NameQualifier" attribute from SAML Request which is from Service Provider. The valid SAML Request is below.

    image

    If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.


    I hope this helps!

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anil Kumar Agrawal 25 Reputation points
    2023-10-10T06:58:27.1966667+00:00

    Valid SAML Request XML (after removing attribute "NameQualifier")

    <saml2p:AuthnRequest AssertionConsumerServiceURL="https://192.168.4.196:2029/saml/success?client_name=SAMLAzureIDPClient" Destination="https://login.microsoftonline.com/7375b099-01f4-477a-973d-be29cb2c4c85/saml2" ForceAuthn="false" ID="_8230404c9fdc4f3ab8036f3e98fd2dd812d5b8f" IsPassive="false" IssueInstant="2023-10-05T11:16:32.904Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Version="2.0"
    	xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol">
    	<saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity"
    		xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">interraorionott
    	</saml2:Issuer>
    </saml2p:AuthnRequest>
    
    1 person found this answer helpful.
    0 comments No comments

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.