No, the saml.persistent name field doesn't need to be a mapper for saml
assertion, it's only a user attribute. So you could add this attribute to
users when they're created or imported or even afterwards with some Admin
API tooling. All that's required on the client end is setting the Name ID
format field to "persistent".
On Mon, Oct 17, 2016 at 2:25 AM, Niels Bertram <nielsbne(a)gmail.com> wrote:
setting the Name ID Format does not set the NameID field value to the
email address of the user model. Whatever I set it to, the only value I can
see in the SAML response is the realm users username.
Thanks for pointing to the persistent Name ID configuration. Just to
confirm, to make this work, one will also have to configure a Property
Mapper in the SAML Client configuration with following details:
Name: Swap NameID username for email
Consent Required: off
Mapper Type: User Attribute
User Attribute: email
Friendly Name: Email
SAML Attribute Name: saml.persistent.name.id.for.$clientId
SAML Attribute NameFormat: Unspecified
Does that look about right?
On Sat, Oct 15, 2016 at 12:54 AM, Jared Blashka <jblashka(a)redhat.com>
> Does setting the 'Name ID Format' option to email in the client settings
> not accomplish what you're looking for? That's supposed to use the
> email address as the NameID.
> Failing that, I know that if you use the 'persistent' Name ID format you
> can set an attribute of saml.persistent.name.id.for.$clientId for a user
> adnd the value of that field gets used as the NameID.
> On Thu, Oct 13, 2016 at 10:31 PM, Niels Bertram <nielsbne(a)gmail.com>
>> Hi guys,
>> I have a requirement to map a user email to the /saml:Subject/saml:NameID
>> field in a Keycloak SAML client. I can see that someone else is asking
>> the same at
>> without much luck. The mapper only maps attributes while I need to change
>> the subjects identifier.
>> Could anyone help with a thought on how that can be achieved?
>> Many thanks,
>> keycloak-user mailing list