keycloak-scim/docs/guides/securing-apps/partials/saml/sp_principalname_mapping_element.adoc
rmartinc ccab30d5f2 Move saml documentation to guides
Closes #31330

Signed-off-by: rmartinc <rmartinc@redhat.com>
2024-07-24 11:50:24 +02:00

27 lines
887 B
Text

== SP PrincipalNameMapping element
This element is optional.
When creating a Java Principal object that you obtain from methods such as `HttpServletRequest.getUserPrincipal()`, you can define what name is returned by the `Principal.getName()` method.
[source,xml]
----
<SP ...>
<PrincipalNameMapping policy="FROM_NAME_ID"/>
</SP>
<SP ...>
<PrincipalNameMapping policy="FROM_ATTRIBUTE" attribute="email" />
</SP>
----
The `policy` attribute defines the policy used to populate this value.
The possible values for this attribute are:
FROM_NAME_ID::
This policy just uses whatever the SAML subject value is. This is the default setting
FROM_ATTRIBUTE::
This will pull the value from one of the attributes declared in the SAML assertion received from the server.
You'll need to specify the name of the SAML assertion attribute to use within the `attribute` XML attribute.