Error generating SAML token using SAML Policy.

HI all,

I am new to the concept of SAML Authentication/Authorization, i tried creating a simple No Target API proxy which will generate a SAML Token and send it as a response to the client. But when i tried creating one and tried tracing the API Proxy, i get the below error.

{"fault":{"faultstring":"GenerateSAMLAssertion[Generate_SAML]: Error transforming assertion into message.","detail":{"errorcode":"steps.saml.generate.ErrorUpdatingPayload"}}}

Steps which i followed in creating the proxy are:

1. Created a Self Signed Certifcate and uploaded it to key store

2. Created a No Target Proxy

a. Added a "Generate SAML Assertion" at the Post Flow, below is the SAML Policy

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<GenerateSAMLAssertion ignoreContentType="true" name="Generate_SAML">
    <DisplayName>Generate_SAML</DisplayName>
    <CanonicalizationAlgorithm/>
    <KeyStore>
        <Name>my_keystore_name</Name>
        <Alias>my_keystore_alias_name</Alias>
    </KeyStore>
    <Subject>ApigeeUser</Subject>
    <Issuer>Apigee</Issuer>
    <SignatureAlgorithm/>
    <!-- <Template ignoreUnresolvedVariables="false"></Template>-->
    <OutputVariable>
        <Message name="message">
            <Namespaces>
                <Namespace prefix="test">http://www.example.com/test</Namespace>
            </Namespaces>
            <XPath>/envelope/header</XPath>
        </Message>
        <FlowVariable name="assertion.content"/>
    </OutputVariable>
</GenerateSAMLAssertion>
0 3 605
3 REPLIES 3

Is the policy attached to "Response" flow in "PostFlow". Otherwise, it is also worth modifying Message element to response.

<Message name="response">

A relevant community article is here.

https://community.apigee.com/articles/37587/saml-assertion-policies-study.html

@Madhan Sadasivam I have added the policy to the Response in Post Flow, still i see the same error.


I tried to implementing the example from the URL which you have posted, the article is missing some clarity.

I got the solution, i had to remove the Message Tag and it worked