# SAML configuration with NameID as unspecified

**URL:** <https://discuss.elastic.co/t/saml-configuration-with-nameid-as-unspecified/222704>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [March 9, 2020, 12:02pm UTC](https://discuss.elastic.co/t/saml-configuration-with-nameid-as-unspecified/222704 "2020-03-09T12:02:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AjitR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ajitr/32/51311_2.png) [@AjitR](https://discuss.elastic.co/u/AjitR)\
**Post date:** [March 9, 2020, 12:02pm UTC](https://discuss.elastic.co/t/saml-configuration-with-nameid-as-unspecified/222704/1 "2020-03-09T12:02:33Z")

</div>

Hi All,  
For SAML configuration, what parameter to be used instead of persistent,  
attributes.principal: "nameid:persistent"

In Azure it is 'unspecified' or emailaddress

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [March 9, 2020, 9:10pm UTC](https://discuss.elastic.co/t/saml-configuration-with-nameid-as-unspecified/222704/2 "2020-03-09T21:10:27Z")

</div>

You can use `attributes.principal: nameid` ,this is also covered in our [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/master/saml-guide-authentication.html#saml-attribute-mapping-nameid)

---

<div class="post-metadata">

**Author:** ![AjitR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ajitr/32/51311_2.png) [@AjitR](https://discuss.elastic.co/u/AjitR)\
**Post date:** [March 12, 2020, 4:02pm UTC](https://discuss.elastic.co/t/saml-configuration-with-nameid-as-unspecified/222704/3 "2020-03-12T16:02:35Z")

</div>

Thanks @ikakavas.  
I tried with attributes.principal: "nameid" but didnt worked.  
So i Used : attributes.principal: "[http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name](http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name)"

Browser Asks to save SAML response.

F12 Developer Tools -  
Response Body -  
{"statusCode":401,"error":"Unauthorized","message":"[security\_exception] unable to authenticate user [] for action [cluster:admin/xpack/security/saml/authenticate], with { header={ WWW-Authenticate={ 0="Bearer realm=\"security\"" & 1="ApiKey" & 2="Basic realm=\"security\" charset=\"UTF-8\"" } } }"}

ES Logs :  
"[WARN][o.e.x.s.a.AuthenticationService] [SA145] Authentication to realm saml1 failed - Provided SAML response is not valid for realm saml/saml1 (Caused by ElasticsearchSecurityException[SAML content is in-response-to \_afe391812ba357beef3a6c11113b8b80f4bbd1c5 but expected one of])"

Not getting whats going wrong here here.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 9, 2020, 4:13pm UTC](https://discuss.elastic.co/t/saml-configuration-with-nameid-as-unspecified/222704/4 "2020-04-09T16:13:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
