פתרון בעיות בהטמעה של מדיניות טענות נכוֹנוּת (assertions) של SAML

אתם צופים במסמכי התיעוד של Apigee ושל Apigee Hybrid.
לעיון במסמכי התיעוד של Apigee Edge.

SourceNotConfigured

הודעת השגיאה

פריסת ה-proxy ל-API דרך ממשק המשתמש של Apigee או Apigee API נכשלת עם הודעת השגיאה הבאה:

Error Deploying Revision revision_number to environment
ValidateSAMLAssertion[policy_name]: Source is not correctly configured.

הודעת שגיאה לדוגמה

Error Deploying Revision 2 to test
ValidateSAMLAssertion[Validate-SAML-Assertion-1]: Source is not correctly configured.

דוגמה לצילום מסך של שגיאה

שגיאה בפריסת גרסה 2 לבדיקה.

מטרה

הפריסה של ה-proxy ל-API נכשלת עם השגיאה הזו אם אחד או יותר מהרכיבים הבאים במדיניות ValidateSAMLAssertion לא מוגדרים או ריקים: <Source>, ‏ <XPath>, ‏ <Namespaces>, ‏ <Namespace>.

לדוגמה, אם לא תכללו את הרכיב <XPath> או תשאירו את הרכיב <Source> או את הישויות שלו ריקים, פריסת ה-proxy ל-API תיכשל.

אבחון

  1. מזהים את שם המדיניות ValidateSAMLAssertion שנכשל מתוך הודעת השגיאה. לדוגמה, בשגיאה הבאה, שם המדיניות ValidateSAMLAssertion הוא Validate-SAML-Assertion-1.

    ValidateSAMLAssertion[Validate-SAML-Assertion-1]: Source is not correctly configured.
    
  2. בודקים את קובץ ה-XML של המדיניות שנכשל.ValidateSAMLAssertion בודקים אם אחד או יותר מהרכיבים הבאים של המדיניות חסרים או ריקים: <Source>, ‏ <XPath>, ‏ <Namespaces>, ‏ <Namespace>. אם כן, יכול להיות שזו הסיבה לשגיאה.

    לדוגמה, במדיניות הבאה יש רכיב <Namespaces> ריק מתחת לרכיב <Source>:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ValidateSAMLAssertion name="SAML" ignoreContentType="false">
      <Source name="request">
        <Namespaces></Namespaces>
       </Source>
       <Description/>
     <TrustStore>ref://TrustStoreName</Truststore>
     <RemoveAssertion>false</RemoveAssertion>
    </ValidateSAMLAssertion>
    
  3. בדוגמה שלמעלה, הרכיב <Namespaces> ריק, ולכן מתקבלת השגיאה:

    ValidateSAMLAssertion[Validate-SAML-Assertion-1]: Source is not correctly configured.
    

רזולוציה

מוודאים שהערכים של הרכיב <Source> מוגדרים בצורה נכונה עם הרכיב <Namespaces> ורכיב הצאצא שלו <Namespace>. צריך גם לוודא שהרכיב <XPath> מוגדר ומלא.

כדי לתקן את המדיניות ValidateSAMLAssertion שמוצגת למעלה, אפשר להוסיף את הרכיבים <Namespace> וגם את <XPath>:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ValidateSAMLAssertion name="SAML" ignoreContentType="false">
  <Source name="request">
    <Namespaces>
      <Namespace prefix='soap'>http://schemas.xmlsoap.org/soap/envelope/</Namespace>
      <Namespace prefix='wsse'>http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd</Namespace>
      <Namespace prefix='saml'>urn:oasis:names:tc:SAML:2.0:assertion</Namespace>
    </Namespaces>
    <XPath>/soap:Envelope/soap:Header/wsse:Security/saml:Assertion</XPath>
  </Source>
   <Description/>
<TrustStore>ref://TrustStoreName</Truststore>
<RemoveAssertion>false</RemoveAssertion>
</ValidateSAMLAssertion>

TrustStoreNotConfigured

הודעת השגיאה

פריסת ה-proxy ל-API דרך ממשק המשתמש של Apigee או Apigee API נכשלת עם הודעת השגיאה הבאה:

Error Deploying Revision revision_number to environment
ValidateSAMLAssertion[[Ljava.lang.Object;@object]: Trust store is not correctly configured.

הודעת שגיאה לדוגמה

Error Deploying Revision 2 to test
ValidateSAMLAssertion[[Ljava.lang.Object;@39537262]: Trust store is not correctly configured.

דוגמה לצילום מסך של שגיאה

שגיאה בפריסת גרסה 2 לבדיקה.

מטרה

אם הרכיב <TrustStore> ריק או לא מצוין במדיניות ValidateSAMLAssertion, הפריסה של שרת ה-API הפרוקסי תיכשל. חובה לבחור חנות מהימנה תקינה.

אבחון

  1. בודקים את כל כללי המדיניות של Validate SAML Assertion (אימות טענת נכונות (assertion) של SAML) ב-API Proxy הספציפי שבו התרחשה השגיאה. אם יש מדיניות Validate SAML Assertion שבה הרכיב <TrustStore> ריק או לא צוין, זו הסיבה לשגיאה.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ValidateSAMLAssertion name="SAML" ignoreContentType="false">
     <Source name="request">
        <Namespaces>
          <Namespace prefix='soap'>http://schemas.xmlsoap.org/soap/envelope/</Namespace>
          <Namespace prefix='wsse'>http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd</Namespace>
          <Namespace prefix='saml'>urn:oasis:names:tc:SAML:2.0:assertion</Namespace>
        </Namespaces>
        <XPath>/soap:Envelope/soap:Header/wsse:Security/saml:Assertion</XPath>
      </Source>
        <Description/>
        <TrustStore/>
      <RemoveAssertion>false</RemoveAssertion>
    </ValidateSAMLAssertion>
    

רזולוציה

חשוב לוודא שהרכיב <TrustStore> תמיד מצוין ולא ריק בתוך מדיניות SAMLAssertion. השם צריך להיות זהה לשם של TrustStore תקין שקיים בכל הסביבות שבהן אתם מנסים לפרוס פרוקסי.<TrustStore>

כדי לתקן את הדוגמה שלמעלה, אפשר לציין את רכיב <TrustStore> עם ערך תקין.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ValidateSAMLAssertion name="SAML" ignoreContentType="false">
  <Source name="request">
    <Namespaces>
      <Namespace prefix='soap'>http://schemas.xmlsoap.org/soap/envelope/</Namespace>
      <Namespace prefix='wsse'>http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd</Namespace>
      <Namespace prefix='saml'>urn:oasis:names:tc:SAML:2.0:assertion</Namespace>
    </Namespaces>
    <XPath>/soap:Envelope/soap:Header/wsse:Security/saml:Assertion</XPath>
  </Source>
  <TrustStore>TrustStoreName</TrustStore>
  <RemoveAssertion>false</RemoveAssertion>
</ValidateSAMLAssertion>

NullKeyStore

הודעת השגיאה

פריסת ה-proxy ל-API דרך ממשק המשתמש של Apigee או דרך API נכשלת עם הודעת השגיאה הבאה:

Error Deploying Revision revision_number to environment
Assertion KeyStore name cannot be null.

הודעת שגיאה לדוגמה

Error Deploying Revision 4 to test
Assertion KeyStore name cannot be null.

דוגמה לצילום מסך של שגיאה

שגיאה בפריסת גרסה 4 לבדיקה.

מטרה

אם אלמנט הצאצא <Name> ריק או לא מצוין באלמנט <Keystore> של מדיניות GenerateSAMLAssertion, ה-Deployment (פריסה) של ה-proxy ל-API תיכשל. חובה להזין שם תקין של מאגר מפתחות.

אבחון

  1. בודקים את כל GenerateSAMLAssertion כללי המדיניות ב-API Proxy הספציפי שבו התרחשה הכשל. אם יש מדיניות GenerateSAMLAssertion שבה אלמנט הצאצא <Name> ריק או לא צוין באלמנט <Keystore>, זו הסיבה לשגיאה.

    במדיניות GenerateSAMLAssertion הבאה יש רכיב צאצא ריק <Name> ברכיב <Keystore>:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <GenerateSAMLAssertion name="SAML" ignoreContentType="false">`
      <CanonicalizationAlgorithm />
      <Issuer ref="reference">Issuer name</Issuer>
      <KeyStore>
        <Name></Name>
        <Alias ref="reference">alias</Alias>
      </KeyStore>
      <OutputVariable>
        <FlowVariable>assertion.content</FlowVariable>
        <Message name="request">
          <Namespaces>
            <Namespace prefix="test">http://www.example.com/test</Namespace>
          </Namespaces>
          <XPath>/envelope/header</XPath>
        </Message>
      </OutputVariable>
      <SignatureAlgorithm />
      <Subject ref="reference">Subject name</Subject>
      <Template ignoreUnresolvedVariables="false">
        <!-- A lot of XML goes here, in CDATA, with {} around
             each variable -->
      </Template>
    </GenerateSAMLAssertion>
    

רזולוציה

מוודאים שרכיב הצאצא <Name> תמיד מצוין ולא ריק בתוך רכיב <Keystore> של מדיניות GenerateSAMLAssertion.

כדי לתקן את הדוגמה שלמעלה, צריך לציין את רכיב <Name> בצורה נכונה ולוודא שצוין ערך תקין לרכיב <Alias>.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<GenerateSAMLAssertion name="SAML" ignoreContentType="false">
  <CanonicalizationAlgorithm />
  <Issuer ref="reference">Issuer name</Issuer>
  <KeyStore>
    <Name ref="reference">keystorename</Name>
    <Alias ref="reference">alias</Alias>
  </KeyStore>
  <OutputVariable>
    <FlowVariable>assertion.content</FlowVariable>
    <Message name="request">
      <Namespaces>
        <Namespace prefix="test">http://www.example.com/test</Namespace>
      </Namespaces>
      <XPath>/envelope/header</XPath>
    </Message>
  </OutputVariable>
  <SignatureAlgorithm />
  <Subject ref="reference">Subject name</Subject>
  <Template ignoreUnresolvedVariables="false">
    <!-- A lot of XML goes here, in CDATA, with {} around
         each variable -->
  </Template>
</GenerateSAMLAssertion>

אפשר לעיין בדוגמאות מתוך מדיניות SAMLAssertion.

NullKeyStoreAlias

הודעת השגיאה

פריסת ה-proxy ל-API דרך ממשק המשתמש של Apigee או Apigee API נכשלת עם הודעת השגיאה הבאה:

Error Deploying Revision revision_number to environment
Assertion KeyStore alias cannot be null.

הודעת שגיאה לדוגמה

Error Deploying Revision 4 to test
Assertion KeyStore alias cannot be null.

דוגמה לצילום מסך של שגיאה

שגיאה בפריסת גרסה 4 לבדיקה.

מטרה

אם אלמנט הצאצא <Alias> ריק או לא מצוין באלמנט <Keystore> של מדיניות GenerateSAMLAssertion, ה-Deployment (פריסה) של ה-proxy ל-API תיכשל. חובה להזין כינוי תקין של Keystore.

אבחון

  1. בודקים את כל GenerateSAMLAssertion כללי המדיניות ב-API Proxy הספציפי שבו התרחשה הכשל. אם יש מדיניות GenerateSAMLAssertion שבה אלמנט הצאצא <Alias> ריק או לא צוין באלמנט <Keystore>, זו הסיבה לשגיאה.

    ב-GenerateSAMLAssertion הבא יש רכיב צאצא ריק <Alias> ברכיב <Keystore>:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <GenerateSAMLAssertion name="SAML" ignoreContentType="false">`
      <CanonicalizationAlgorithm />
      <Issuer ref="reference">Issuer name</Issuer>
      <KeyStore>
        <Name ref="reference">keystorename</Name>
        <Alias></Alias>
      </KeyStore>
      <OutputVariable>
        <FlowVariable>assertion.content</FlowVariable>
        <Message name="request">
          <Namespaces>
            <Namespace prefix="test">http://www.example.com/test</Namespace>
          </Namespaces>
          <XPath>/envelope/header</XPath>
        </Message>
      </OutputVariable>
      <SignatureAlgorithm />
      <Subject ref="reference">Subject name</Subject>
      <Template ignoreUnresolvedVariables="false">
        <!-- A lot of XML goes here, in CDATA, with {} around
             each variable -->
      </Template>
    </GenerateSAMLAssertion>
    

רזולוציה

מוודאים שרכיב הבן <Name> תמיד מצוין ולא ריק בתוך רכיב <Keystore> של מדיניות GenerateSAMLAssertion.

כדי לתקן את הדוגמה שלמעלה, צריך לציין את רכיב <Alias> בצורה נכונה ולוודא שצוין ערך תקין לרכיב <Name>.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<GenerateSAMLAssertion name="SAML" ignoreContentType="false">
  <CanonicalizationAlgorithm />
  <Issuer ref="reference">Issuer name</Issuer>
  <KeyStore>
    <Name ref="reference">keystorename</Name>
    <Alias ref="reference">alias</Alias>
  </KeyStore>
  <OutputVariable>
    <FlowVariable>assertion.content</FlowVariable>
    <Message name="request">
      <Namespaces>
        <Namespace prefix="test">http://www.example.com/test</Namespace>
      </Namespaces>
      <XPath>/envelope/header</XPath>
    </Message>
  </OutputVariable>
  <SignatureAlgorithm />
  <Subject ref="reference">Subject name</Subject>
  <Template ignoreUnresolvedVariables="false">
    <!-- A lot of XML goes here, in CDATA, with {} around
         each variable -->
  </Template>
</GenerateSAMLAssertion>

אפשר לעיין בדוגמאות מתוך מדיניות SAMLAssertion.

NullIssuer

הודעת השגיאה

פריסת ה-proxy ל-API דרך ממשק המשתמש של Apigee או Apigee API נכשלת עם הודעת השגיאה הבאה:

Error Deploying Revision revision_number to environment
Assertion Issuer cannot be null.

הודעת שגיאה לדוגמה

Error Deploying Revision 4 to test
Assertion Issuer cannot be null.

דוגמה לצילום מסך של שגיאה

שגיאה בפריסת גרסה 4 לבדיקה.

מטרה

אם הרכיב <Issuer> ריק או לא מצוין במדיניות GenerateSAMLAssertion, פריסת ה-proxy ל-API תיכשל. חובה לציין ערך תקין של <Issuer>.

אבחון

  1. בודקים את כל GenerateSAMLAssertion כללי המדיניות ב-API Proxy הספציפי שבו התרחשה הכשל. אם יש מדיניות GenerateSAMLAssertion שבה הרכיב <Issuer> ריק או לא מוגדר, זו הסיבה לשגיאה.

    למדיניות GenerateSAMLAssertion הבאה יש רכיב <Issuer> ריק:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <GenerateSAMLAssertion name="SAML" ignoreContentType="false">`
      <CanonicalizationAlgorithm />
      <Issuer></Issuer>
      <KeyStore>
        <Name ref="reference">keystorename</Name>
        <Alias ref="reference">alias</Alias>
      </KeyStore>
      <OutputVariable>
        <FlowVariable>assertion.content</FlowVariable>
        <Message name="request">
          <Namespaces>
            <Namespace prefix="test">http://www.example.com/test</Namespace>
          </Namespaces>
          <XPath>/envelope/header</XPath>
        </Message>
      </OutputVariable>
      <SignatureAlgorithm />
      <Subject ref="reference">Subject name</Subject>
      <Template ignoreUnresolvedVariables="false">
        <!-- A lot of XML goes here, in CDATA, with {} around
             each variable -->
      </Template>
    </GenerateSAMLAssertion>
    

רזולוציה

חשוב לוודא שרכיב <Issuer> תמיד מצוין ולא ריק במדיניות GenerateSAMLAssertion.

כדי לתקן את הדוגמה שלמעלה, צריך לציין את רכיב <Issuer> בצורה נכונה:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<GenerateSAMLAssertion name="SAML" ignoreContentType="false">
  <CanonicalizationAlgorithm />
  <Issuer ref="reference">Issuer name</Issuer>
  <KeyStore>
    <Name ref="reference">keystorename</Name>
    <Alias ref="reference">alias</Alias>
  </KeyStore>
  <OutputVariable>
    <FlowVariable>assertion.content</FlowVariable>
    <Message name="request">
      <Namespaces>
        <Namespace prefix="test">http://www.example.com/test</Namespace>
      </Namespaces>
      <XPath>/envelope/header</XPath>
    </Message>
  </OutputVariable>
  <SignatureAlgorithm />
  <Subject ref="reference">Subject name</Subject>
  <Template ignoreUnresolvedVariables="false">
    <!-- A lot of XML goes here, in CDATA, with {} around
         each variable -->
  </Template>
</GenerateSAMLAssertion>

אפשר לעיין בדוגמאות מתוך מדיניות SAMLAssertion.