2016-06-02 16:07:45 +00:00
2024-07-22 08:16:24 +00:00
== SP PrincipalNameMapping element
2016-06-02 16:07:45 +00:00
This element is optional.
2017-03-21 18:25:37 +00:00
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.
2016-06-02 20:50:43 +00:00
[source,xml]
----
<SP ...>
<PrincipalNameMapping policy="FROM_NAME_ID"/>
</SP>
<SP ...>
<PrincipalNameMapping policy="FROM_ATTRIBUTE" attribute="email" />
</SP>
----
2016-06-02 16:07:45 +00:00
The `policy` attribute defines the policy used to populate this value.
2016-06-02 20:50:43 +00:00
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.