版本: 7.7-7.15
简而言之,当Elasticsearch中请求的NameID格式与允许的NameID格式不匹配时,会出现此错误。这可能是由于配置错误或数据类型不匹配导致的。要解决此问题,您可以:1) 检查并更正请求中的NameID格式。2) 验证Elasticsearch配置中允许的NameID格式,并根据需要进行调整。3) 确保NameID的数据类型与允许的格式匹配。
日志上下文 #
日志"The requested NameID format [{}] doesn’t match the allowed NameID format"的类名是 SamlAuthnRequestValidator.java。 我们从Elasticsearch源代码中提取了以下内容,供那些需要深入了解上下文的人参考:
final String requestedFormat = nameIDPolicy.getFormat();
final String allowedFormat = sp.getAllowedNameIdFormat();
if (Strings.hasText(requestedFormat)) {
if (allowedFormat != null && requestedFormat.equals(UNSPECIFIED) == false
&& requestedFormat.equals(allowedFormat) == false) {
throw new ElasticsearchSecurityException("The requested NameID format [{}] doesn't match the allowed NameID format" +
" for this Service Provider which is [{}]"; requestedFormat; sp.getAllowedNameIdFormat());
} else {
authnState.put(SamlAuthenticationState.Fields.NAMEID_FORMAT.getPreferredName(); requestedFormat);
}
}





