|
From: Piotr P. <pio...@gm...> - 2017-11-20 21:37:17
|
Hi
W dniu 20.11.2017 o 22:31, Krzysztof Benedyczak pisze:
> Hi,
>
> W dniu 20.11.2017 o 19:40, D Baum pisze:
>> Hi,
>>
>> my Unity entities have an "email" attribute, which I'd like to send
>> along in SAML Assertions to my SP (which authenticates against Unity).
>>
>> To do this, I've created an output translation profile which contains
>> this rule:
>>
>> Condition: attr contains 'email'
>> Action: createAttribute
>> Action parameters: attributeName = urn:mace:dir:attribute-def:mail
>> expression = attr['email']
>> mandatory = false
>> attributeDisplayName = urn:mace:dir:attribute-def:mail
>> attributeDescription = email
>>
>>
>> This makes Unity send the following in the
>> urn:mace:dir:attribute-def:mail attribute:
>> {"value":"fo...@ba...","confirmationData":{"[...]
>>
>> How can I change the MVEL expression of the rule to _only_ send the
>> value fo...@ba...? I've tried all combinations of attr['email'].value,
>> attr.email.value, etc, I could think of - but no success.
>>
>> Is there a way to get at only the email string?
>
> First of all you have hit a bug introduced while ago, that we also
> found very recently and is already fixed - will be included in the
> next release.
>
> The workaround isn't easy. It can be done with a complex MVEL expr
> only I guess.
>
> @Piotr: can you share your snippet that you have shown recently to me?
> Should help here.
>
Try put this as expression
import com.fasterxml.jackson.databind.ObjectMapper; import
java.util.HashMap; new ObjectMapper().readValue(attr['email'],
HashMap.class).get('value')
Cheers
Piotr
> Best,
> Krzysztof
>
> ------------------------------------------------------------------------------
>
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Unity-idm-discuss mailing list
> Uni...@li...
> https://lists.sourceforge.net/lists/listinfo/unity-idm-discuss
|