search cancel

Broadcom API Gateway - Validate SAML Token fails with "SAML token validation errors: Unable to parse SAML token: AssertionID missing or empty"


Article ID: 229236


Updated On:


CA API Gateway


While trying to validate a non-soap SAML token, the Validate SAML Token assertion throws below error in spite of the presence of AssertionID tag in the inbound SAML token. 

WARNING 2073 com.l7tech.external.assertions.validatenonsoapsaml.server.ServerValidateNonSoapSamlTokenAssertion: 6104: SAML token validation errors: Unable to parse SAML token: AssertionID missing or empty

Here an example of request's body containing the offended SAML token with the included Assertion ID:

<samlp:Response ID="_a4958bfd-e107-4e67-b06d-0d85ade2e76a" Version="2.0" IssueInstant="2013-03-18T07:38:15.144Z" Destination="" InResponseTo="id758d0ef385634593a77bdf7e632984b6" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
  <Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion"></Issuer>
  <ds:Signature xmlns:ds="">
    <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
  <Assertion ID="_bf9c623d-cc20-407a-9a59-c2d0aee84d12" IssueInstant="2013-03-18T07:38:15.144Z" Version="2.0" xmlns="urn:oasis:names:tc:SAML:2.0:assertion">
    <ds:Signature xmlns:ds="">
      <SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
        <SubjectConfirmationData InResponseTo="id758d0ef385634593a77bdf7e632984b6" NotOnOrAfter="2013-03-18T07:43:15.144Z" Recipient="" />
    <Conditions NotBefore="2013-03-18T07:38:15.128Z" NotOnOrAfter="2013-03-18T08:48:15.128Z">
      <Attribute Name="">
        <AttributeValue>[email protected]</AttributeValue>
      <Attribute Name="">
    <AuthnStatement AuthnInstant="2013-03-18T07:33:56.000Z" SessionIndex="_bf9c623d-cc20-407a-9a59-c2d0aee84d12">
        <AuthnContextClassRef> urn:oasis:names:tc:SAML:2.0:ac:classes:Password</AuthnContextClassRef>


Specific tokens (for example from Microsoft Azure AD) may not be generated in the correct format expected by the Evaluate SAML Token assertion, causing attributes not to be parsed during the validation and leading to a failure in the policy process. 



Release : 9.4/10.0+

Component : Broadcom API Gateway


Under this specific scenario, it is recommended to manually parse the validation's element (Assertion ID) from the request body, then store it in a variable and use the variable (not the request itself) against the Evaluate SAML Token assertion. 

In roder to do so:

  • Add Evaluate Request XPATH assertion before Validate SAML assertion 

  • Double click on the new added assertion and :

- Click on the ADD button (1)

- Give a name to the Sample Message (2)

- Paste the SAML response body in the XML Document box and (VERY IMPORTANT) select/highlight the Assertion ID element (3) that needs to be parsed

- Click OK (4) 

- Assign a Variable Prefix (5) and click OK to save the assertion configuration. Take note of the prefix name as we will use it later when we setup a context variable.


  • Add a Set Context Variable assertion, give to it a name (in this example is called assertionid ), set the Data Type as Message, Content-Type as text/xml and set the Expression as ${variable01.element} . The name before ".element" must match with the Variable Prefix name previously used in the Evaluate Request XPath


  • Right click on Validate SAML assertion and from the menu, click on Select Target Message

  • Select Other Context Variable and in the empty field, insert the Context Variable created previously.

The final policy logic should look something like below: