The error you get is because you have configured Elasticsearch to try and map the principal attribute from the NameID with persistent format that it finds in the subject of the SAML Assertion. Since this is not found in the assertion, authentication fails because principal is required.
nameid:persistent has a specific meaning for the Elastic Stack SAML SP as described here . I'm not very familiar with ADFS but the screenshot you provided seems to imply that ADFS will be sending the UPN as a SAML Attribute in the SAML Response's Attribute Statement with a name of nameid and not as the SAML NameID in the Assertion's subject. Or that it is releasing it as a NameID but with the wrong format (if I remember correctly from other posts in the forums, the default format for NameID in ADFS is urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified. You can verify my assumption by setting the SAML log to trace in Elasticsearch with
and looking at your the elasticsearch logs ( we print out the SAML Response and the attributes we extract from it ). Alternatively you can use a browser plugin (i.e. SAML tracer) to see the SAML Response in your browser.
When it comes to solutions for your problem now, you can either:
Figure out how to configure ADFS to send out a NameID with format urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
Map principal to the claim that you have configured ADFS to release, if this is the case.
From the original configuration you shared, I don't see you mapping the roles claim from ADFS into anything in Elasticsearch. See the relevant part of our guide
I think the easiest path forward is to map the roles claim ( i.e. http://schemas.microsoft.com/ws/2008/06/identity/claims/role ) to the groups attribute of the Elasticsearch user by adding
So I map Token-Groups - Unqualified Names to the predefined Role outgoing claim. Then, when I use the api to assign a role to one of the users groups it works.
As a test I used this:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.