<ph type="x-smartling-placeholder"></ph>
  您正在查看 Apigee Edge 文档。
  转到
     Apigee X 文档。 信息
SourceNotConfigured
错误消息
通过 Edge 界面或 Edge 管理部署 API 代理 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.
错误屏幕截图示例

原因
如果一个或多个验证 SAML 断言政策的以下元素未定义或为空,API 代理的部署将失败并显示此错误:<Source>、<XPath>、<Namespaces>、<Namespace>。
例如,如果您缺少 <XPath> 元素或将 <Source> 元素或其实体留空,则 API 代理的部署将失败。
诊断
- 从错误消息中标识失败的验证 SAML 断言政策名称。例如,在以下错误中,验证 SAML 断言政策名称为 - Validate-SAML-Assertion-1。- ValidateSAMLAssertion[Validate-SAML-Assertion-1]: Source is not correctly configured.
- 检查失败的验证 SAML 断言政策 XML。检查政策中的以下一个或多个元素是否缺失或为空: - <Source>、- <XPath>、- <Namespaces>、- <Namespace>。如果是这样,可能会导致错误。- 例如,以下政策在 - <Source>元素下有一个空- <Namespaces>元素:- <?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>
- 在上面的示例中, - <Namespaces>元素为空,因此您会收到以下错误:- ValidateSAMLAssertion[Validate-SAML-Assertion-1]: Source is not correctly configured.
解决方法
确保使用 <Namespaces> 元素及其子元素 <Namespace> 正确配置 <Source> 元素的值。您还需要确保 <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
错误消息
通过 Edge 界面或 Edge 管理部署 API 代理 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> 元素为空或未在 ValidateSAMLAssertion 政策中指定,则 API 代理部署将失败。需要有效的信任库。
诊断
- 检查失败的特定 API 代理中的所有验证 SAML 断言政策。如果存在任何 - <TrustStore>元素为空或未指定的验证 SAML 断言政策,则会导致错误。- <?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> 元素。
<?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
错误消息
通过 Edge 界面或 Edge 部署 API 代理 Management 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> 为空或未在 GenerateSAMLAssertion 政策的 <Keystore> 元素中指定,则 API 代理部署将失败。需要有效的密钥库名称。
诊断
- 检查失败的特定 API 代理中的所有生成 SAML 断言政策。如果存在子元素 - <Name>为空或未在- <Keystore>元素中指定的任何生成 SAML 断言政策,则会导致错误。- 以下生成 SAML 断言政策在 - <Keystore>元素中包含空子元素- <Name>:- <?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>
解决方法
确保在生成 SAML 断言政策的 <Keystore> 元素中始终指定子元素 <Name> 且非空。
如需更正上面的示例,您可以正确指定 <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
错误消息
通过 Edge 界面或 Edge 管理部署 API 代理 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> 为空或未在生成 SAML 断言政策的 <Keystore> 元素中指定,则 API 代理部署将失败。需要有效的密钥库别名。
诊断
- 检查失败的特定 API 代理中的所有生成 SAML 断言政策。如果存在子元素 - <Alias>为空或未在- <Keystore>元素中指定的任何生成 SAML 断言政策,则会导致错误。- 以下生成 SAML 断言政策在 - <Keystore>元素中包含空子元素- <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></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> 非空
在“Generate SAML Assertion”(生成 SAML 断言)政策的 <Keystore> 元素内。
如需更正上面的示例,您可以正确指定 <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
错误消息
通过 Edge 界面或 Edge 管理部署 API 代理 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> 值。
诊断
- 检查失败的特定 API 代理中的所有生成 SAML 断言政策。如果存在任何 - <Issuer>元素为空或未指定的生成 SAML 断言政策,则会导致错误。- 以下生成 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>
解决方法
确保在生成 SAML 断言政策中始终指定 <Issuer> 元素且非空。
如需更正上面的示例,请正确指定 <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 政策参考文章中的代码示例中的示例。