The requested NameID format doesn t match the allowed NameID format – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.7-7.15

Briefly, this error occurs when the NameID format requested in Elasticsearch doesn’t match the allowed NameID format. This could be due to incorrect configuration or mismatched data types. To resolve this issue, you can: 1) Check and correct the NameID format in your request. 2) Verify the allowed NameID formats in your Elasticsearch configuration and adjust as necessary. 3) Ensure that the data type of your NameID matches the allowed formats.

This guide will help you check for common problems that cause the log ” The requested NameID format [{}] doesn’t match the allowed NameID format ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “The requested NameID format [{}] doesn’t match the allowed NameID format” class name is SamlAuthnRequestValidator.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 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);
 }
 }

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?