การแก้ปัญหาข้อผิดพลาดในการทำให้นโยบายการยืนยัน SAML ใช้งานได้

คุณกำลังดูเอกสารประกอบ Apigee Edge
ไปที่ เอกสารประกอบเกี่ยวกับ Apigee X.
ข้อมูล

SourceNotConfigured

ข้อความแสดงข้อผิดพลาด

การทำให้พร็อกซี API ใช้งานได้ผ่านการจัดการ Edge UI หรือ Edge 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.

ตัวอย่างภาพหน้าจอแสดงข้อผิดพลาด

สาเหตุ

การทำให้พร็อกซี API ใช้งานได้ล้มเหลวโดยมีข้อผิดพลาดนี้ หาก องค์ประกอบต่อไปนี้ของนโยบายตรวจสอบการยืนยันสิทธิ์ SAML ไม่ได้ กำหนดหรือว่างเปล่า: <Source>, <XPath>, <Namespaces>, <Namespace>

เช่น หากคุณขาดองค์ประกอบ <XPath> หรือออกจาก <Source> หรือเอนทิตีของเอนทิตีว่างเปล่า จะทำให้การทำให้พร็อกซี API ใช้งานได้ล้มเหลว

การวินิจฉัย

  1. ระบุชื่อนโยบายการยืนยัน SAML ที่ล้มเหลวจาก ข้อความแสดงข้อผิดพลาด ตัวอย่างเช่น ในข้อผิดพลาดต่อไปนี้คือส่วน "ตรวจสอบ" ชื่อนโยบายการยืนยัน SAML คือ Validate-SAML-Assertion-1

    ValidateSAMLAssertion[Validate-SAML-Assertion-1]: Source is not correctly configured.
    
  2. ตรวจสอบ XML ของนโยบายการยืนยัน SAML ที่ล้มเหลว ตรวจสอบว่ามี องค์ประกอบต่อไปนี้ของนโยบายอย่างน้อย 1 รายการหายไปหรือว่างเปล่า <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> ไว้แล้วและไม่ว่างเปล่า

หากต้องการแก้ไขตัวอย่างนโยบาย "ตรวจสอบการยืนยัน SAML" ที่แสดงด้านบน คุณจะต้อง สามารถเพิ่มองค์ประกอบ <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

ข้อความแสดงข้อผิดพลาด

การทำให้พร็อกซี API ใช้งานได้ผ่านการจัดการ Edge UI หรือ Edge 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.

ตัวอย่างภาพหน้าจอแสดงข้อผิดพลาด

สาเหตุ

หากองค์ประกอบ <TrustStore> ว่างเปล่าหรือไม่ได้ระบุใน นโยบาย VERIFSAMLAssertion จากนั้นจะทำให้ API ใช้งานได้ พร็อกซีไม่ทำงาน ต้องระบุ Trust Store ที่ถูกต้อง

การวินิจฉัย

  1. ตรวจสอบนโยบายตรวจสอบการยืนยันสิทธิ์ SAML ทั้งหมดใน พร็อกซี API ที่เกิดความล้มเหลว หากมีการตรวจสอบ นโยบายการยืนยัน SAML ที่องค์ประกอบ <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> ไว้เสมอและ ไม่ว่างเปล่าภายในนโยบายตรวจสอบการยืนยันสิทธิ์ SAML <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>

โปรดดูข้อมูลเพิ่มเติมเกี่ยวกับวิธีใช้ Truststore ที่ Truststore และคีย์สโตร์

NullKeyStore

ข้อความแสดงข้อผิดพลาด

การทำให้พร็อกซี API ใช้งานได้ผ่าน Edge UI หรือ Edge 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.

ตัวอย่างภาพหน้าจอแสดงข้อผิดพลาด

สาเหตุ

หากองค์ประกอบย่อย <Name> ว่างเปล่าหรือไม่ได้ระบุในองค์ประกอบ <Keystore> ของนโยบาย GenerateSAMLAssertion จากนั้น การทำให้พร็อกซี API ใช้งานได้ล้มเหลว ต้องระบุชื่อคีย์สโตร์ที่ถูกต้อง

การวินิจฉัย

  1. ตรวจสอบนโยบาย Generate SAML Assertion ทั้งหมดใน พร็อกซี API ที่เกิดความล้มเหลว หากมีการสร้าง นโยบายการยืนยัน SAML ที่มีองค์ประกอบย่อย <Name> ว่างเปล่าหรือไม่ได้ระบุในองค์ประกอบ <Keystore> สาเหตุของข้อผิดพลาด

    นโยบาย "สร้างการยืนยัน SAML" ต่อไปนี้มีรายการย่อยที่ว่างเปล่า องค์ประกอบ <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> ของ Generate SAML Assertion

หากต้องการแก้ไขตัวอย่างข้างต้น ให้ระบุองค์ประกอบ <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

ข้อความแสดงข้อผิดพลาด

การทำให้พร็อกซี API ใช้งานได้ผ่านการจัดการ Edge UI หรือ Edge 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.

ตัวอย่างภาพหน้าจอแสดงข้อผิดพลาด

สาเหตุ

หากองค์ประกอบย่อย <Alias> ว่างเปล่าหรือไม่ได้ระบุในองค์ประกอบ <Keystore> ของนโยบาย Generate SAML Assertion จากนั้น การทำให้พร็อกซี API ใช้งานได้ล้มเหลว ต้องมีชื่อแทนคีย์สโตร์ที่ถูกต้อง

การวินิจฉัย

  1. ตรวจสอบนโยบาย Generate SAML Assertion ทั้งหมดใน พร็อกซี API ที่เกิดความล้มเหลว หากมีการสร้าง นโยบายการยืนยัน SAML ที่มีองค์ประกอบย่อย <Alias> ว่างเปล่าหรือไม่ได้ระบุในองค์ประกอบ <Keystore> สาเหตุของข้อผิดพลาด

    นโยบาย "สร้างการยืนยัน SAML" ต่อไปนี้มีรายการย่อยที่ว่างเปล่า องค์ประกอบ <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> ของนโยบาย Generate SAML Assertion

หากต้องการแก้ไขตัวอย่างข้างต้น ให้ระบุองค์ประกอบ <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

ข้อความแสดงข้อผิดพลาด

การทำให้พร็อกซี API ใช้งานได้ผ่านการจัดการ Edge UI หรือ Edge API ไม่ทำงานโดยมีข้อความแสดงข้อผิดพลาดนี้:

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

ตัวอย่างข้อความแสดงข้อผิดพลาด

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

ตัวอย่างภาพหน้าจอแสดงข้อผิดพลาด

สาเหตุ

หากองค์ประกอบ <Issuer> ว่างเปล่าหรือไม่ได้ระบุในส่วน "สร้าง SAML" นโยบายการยืนยัน การทำให้พร็อกซี API ใช้งานได้ล้มเหลว ถูกต้อง ต้องระบุค่า <Issuer>

การวินิจฉัย

  1. ตรวจสอบนโยบาย Generate SAML Assertion ทั้งหมดใน API ที่เฉพาะเจาะจง พร็อกซีที่เกิดความล้มเหลว หากมีไอคอน "สร้าง SAML" นโยบายการยืนยันที่องค์ประกอบ <Issuer> ว่างเปล่าหรือไม่ แสดงว่านี่คือสาเหตุของข้อผิดพลาด

    นโยบาย "สร้างการยืนยัน SAML" ต่อไปนี้มีองค์ประกอบ <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> ไว้เสมอและไม่ว่างเปล่าใน นโยบาย Generate SAML Assertion

หากต้องการแก้ไขตัวอย่างข้างต้น ให้ระบุองค์ประกอบ <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