--- title: "查询字符串不包含 SAMLRequest 参数 - 如何解决此 Elasticsearch 异常" date: 2026-01-23 lastmod: 2026-01-23 description: "此错误发生在 Elasticsearch 的安全断言标记语言 (SAML) 身份认证无法在查询字符串中找到 'SAMLRequest' 参数时。该参数对于 SAML 身份认证至关重要。" tags: ["SAML", "身份认证", "安全", "异常处理"] summary: "版本: 7.7-7.15 简而言之,当 Elasticsearch 的安全断言标记语言 (SAML) 身份认证无法在查询字符串中找到 ‘SAMLRequest’ 参数时,就会发生此错误。该参数对于 SAML 身份认证至关重要。要解决此问题,请确保在查询字符串中包含 SAMLRequest 参数。如果您正在使用 SAML 身份提供商 (IdP),请验证其是否正确配置以发送 SAMLRequest 参数。此外,请检查您应用程序的 SAML 设置,确保它们已正确设置。 日志上下文 # 日志 “Query string [{}] does not contain a SAMLRequest parameter” 的类名是 SamlAuthnRequestValidator.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考: throw new ElasticsearchSecurityException("Invalid Authentication Request query string (zero parameters)"); } logger.trace(new ParameterizedMessage("Parsed the following parameters from the query string: {}"; parameters)); final String samlRequest = parameters.get("SAMLRequest"); if (null == samlRequest) { throw new ElasticsearchSecurityException("Query string [{}] does not contain a SAMLRequest parameter"; RestStatus." --- > **版本:** 7.7-7.15 简而言之,当 Elasticsearch 的安全断言标记语言 (SAML) 身份认证无法在查询字符串中找到 'SAMLRequest' 参数时,就会发生此错误。该参数对于 SAML 身份认证至关重要。要解决此问题,请确保在查询字符串中包含 SAMLRequest 参数。如果您正在使用 SAML 身份提供商 (IdP),请验证其是否正确配置以发送 SAMLRequest 参数。此外,请检查您应用程序的 SAML 设置,确保它们已正确设置。 日志上下文 ----------- 日志 "Query string [{}] does not contain a SAMLRequest parameter" 的类名是 [SamlAuthnRequestValidator.java.](https://www.geeksforgeeks.org/java-lang-class-class-java-set-1/) 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考: ```java throw new ElasticsearchSecurityException("Invalid Authentication Request query string (zero parameters)"); } logger.trace(new ParameterizedMessage("Parsed the following parameters from the query string: {}"; parameters)); final String samlRequest = parameters.get("SAMLRequest"); if (null == samlRequest) { throw new ElasticsearchSecurityException("Query string [{}] does not contain a SAMLRequest parameter"; RestStatus.BAD_REQUEST; queryString); } return new ParsedQueryString( queryString; samlRequest; ```