Skip to content

Commit 5106b58

Browse files
committed
Merge pull request elastic#207 from jkakavas/trb-saml-status
Add troubleshooting information for SAML InvalidNameIDPolicy error
1 parent 94d1e74 commit 5106b58

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

docs/en/stack/security/troubleshooting.asciidoc

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -574,17 +574,37 @@ Authentication in {kib} fails and the following error is printed in the
574574
Authentication to realm my-saml-realm failed -
575575
Provided SAML response is not valid for realm saml/my-saml-realm
576576
(Caused by ElasticsearchSecurityException[SAML Response is not a 'success' response:
577-
Code=urn:oasis:names:tc:SAML:2.0:status:AuthnFailed Message=null Detail=null])
577+
The SAML IdP did not grant the request. It indicated that the Elastic Stack side sent
578+
something invalid (urn:oasis:names:tc:SAML:2.0:status:Requester). Specific status code which might
579+
indicate what the issue is: [urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy]]
580+
)
578581
....
579582

580583
*Resolution:*
581584

582585
This means that the SAML Identity Provider failed to authenticate the user and
583586
sent a SAML Response to the Service Provider ({stack}) indicating this failure.
584-
The `Code`, `Message` and `Detail` can convey different error identifiers and
585-
additional information that might offer an indication about the cause of the
586-
failure. In case `Message` and `Detail` are null, please consult the logs and
587-
documentation of the Identity Provider in order to further diagnose the problem.
587+
The message will convey whether the SAML Identity Provider thinks that the problem
588+
is with the Service Provider ({stack}) or with the Identity Provider itself and
589+
the specific status code that follows is extremely useful as it usually indicates
590+
the underlying issue. The list of specific error codes is defined in the
591+
https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf[SAML 2.0 Core specification - Section 3.2.2.2]
592+
and the most commonly encountered ones are:
593+
594+
. `urn:oasis:names:tc:SAML:2.0:status:AuthnFailed`: The SAML Identity Provider failed to
595+
authenticate the user. There is not much to troubleshoot on the {stack} side for this status, the logs of
596+
the SAML Identity Provider will hopefully offer much more information.
597+
. `urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy`: The SAML Identity Provider cannot support
598+
releasing a NameID with the requested format. When creating SAML Authentication Requests, {es} sets
599+
the NameIDPolicy element of the Authentication request with the appropriate value. This is controlled
600+
by the {ref}/security-settings.html#ref-saml-settings[`nameid_format`] configuration parameter in
601+
`elasticsearch.yml`, which if not set defaults to `urn:oasis:names:tc:SAML:2.0:nameid-format:transient`.
602+
This instructs the Identity Provider to return a NameID with that specific format in the SAML Response. If
603+
the SAML Identity Provider cannot grant that request, for example because it is configured to release a
604+
NameID format with `urn:oasis:names:tc:SAML:2.0:nameid-format:persistent` format instead, it returns this error
605+
indicating an invalid NameID policy. This issue can be resolved by adjusting `nameid_format` to match the format
606+
the SAML Identity Provider can return or by setting it to `urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified`
607+
so that the Identity Provider is allowed to return any format it wants.
588608
--
589609

590610
. *Symptoms:*

0 commit comments

Comments
 (0)