<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div>Thanks Nate, your advice to use a "Mapped AttributeDefinition with regular expressions" was good <br></div><div>so I rewrote my Definition toward a mapped attribute and it seems to work fine this way : </div><div><br data-mce-bogus="1"></div><div><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em><AttributeDefinition id="mail" xsi:type="Mapped"></em></span><br><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em> <AttributeEncoder xsi:type="SAML1String"</em></span><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em> name="urn:mace:dir:attribute-def:mail" /></em></span><br><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em> <AttributeEncoder xsi:type="SAML2String"</em></span><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em> name="urn:oid:0.9.2342.19200300.100.1.3" friendlyName="mail" /></em></span><br><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em> <InputDataConnector ref="myLDAP" attributeNames="mail" /></em></span><br><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em> <DefaultValue passThru="true"/></em></span><br><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em> <ValueMap></em></span><br><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em> <ReturnValue>$1@<strong>newDom.fr</strong></ReturnValue></em></span><br><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em> <SourceValue>(.+)@<strong>initialDom.fr</strong></SourceValue></em></span><br><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em> </ValueMap></em></span><br><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em> <ValueMap></em></span><br><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em> <ReturnValue>$1@<strong>newDom.fr</strong></ReturnValue></em></span><br><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em> <SourceValue>(.+)@<strong>OtherinitialDom.fr</strong></SourceValue></em></span><br><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em> </ValueMap></em></span><br><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em> </AttributeDefinition></em></span><br><br data-mce-bogus="1"></div><div>Associated logs when using this mapped attribute : <br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><span style="font-size: 8pt;" data-mce-style="font-size: 8pt;"><em>2021-01-26 11:00:21,110 - - DEBUG [net.shibboleth.idp.attribute.resolver.impl.AttributeResolverImpl:431] - Attribute Resolver 'ShibbolethAttributeResolver': Resolving dependencies for 'mail'</em></span><br><span style="font-size: 8pt;" data-mce-style="font-size: 8pt;"><em>2021-01-26 11:00:21,111 - - DEBUG [net.shibboleth.idp.attribute.resolver.impl.AttributeResolverImpl:440] - Attribute Resolver 'ShibbolethAttributeResolver': Finished resolving dependencies for 'mail'</em></span><br><span style="font-size: 8pt;" data-mce-style="font-size: 8pt;"><em>2021-01-26 11:00:21,111 - - DEBUG [net.shibboleth.idp.attribute.resolver.ad.mapped.impl.MappedAttributeDefinition:204] - <strong>Attribute Definition 'mail': Attempting to map the following values: [StringAttributeValue{value=teststud@initialDom.fr}]</strong></em></span><br><span style="font-size: 8pt;" data-mce-style="font-size: 8pt;"><em>2021-01-26 11:00:21,112 - - DEBUG [net.shibboleth.idp.attribute.resolver.ad.mapped.impl.MappedAttributeDefinition:163] - Attribute Definition mail: mapping dependency attribute value teststud@<strong>initialDom.fr</strong></em></span><br><span style="font-size: 8pt;" data-mce-style="font-size: 8pt;"><em>2021-01-26 11:00:21,112 - - DEBUG [net.shibboleth.idp.attribute.resolver.ad.mapped.impl.ValueMap:113] - <strong>Attempting to map attribute value 'teststud@initialDom.fr'</strong></em></span><br><span style="font-size: 8pt;" data-mce-style="font-size: 8pt;"><em>2021-01-26 11:00:21,113 - - DEBUG [net.shibboleth.idp.attribute.resolver.ad.mapped.impl.ValueMap:129] - Performing regular expression based comparison</em></span><br><span style="font-size: 8pt;" data-mce-style="font-size: 8pt;"><em>2021-01-26 11:00:21,113 - - DEBUG [net.shibboleth.idp.attribute.resolver.ad.mapped.impl.ValueMap:134] - <strong>Attribute value 'teststud@initialDom.fr' matches regular expression, will be mapped to 'teststud@newDom.fr'</strong></em></span><br><span style="font-size: 8pt;" data-mce-style="font-size: 8pt;"><em>2021-01-26 11:00:21,113 - - DEBUG [net.shibboleth.idp.attribute.resolver.ad.mapped.impl.ValueMap:113] - Attempting to map attribute value 'teststud@initialDom.fr'</em></span><br><span style="font-size: 8pt;" data-mce-style="font-size: 8pt;"><em>2021-01-26 11:00:21,114 - - DEBUG [net.shibboleth.idp.attribute.resolver.ad.mapped.impl.ValueMap:129] - Performing regular expression based comparison</em></span><br><span style="font-size: 8pt;" data-mce-style="font-size: 8pt;"><em>2021-01-26 11:00:21,114 - - DEBUG [net.shibboleth.idp.attribute.resolver.ad.mapped.impl.ValueMap:143] - Value teststud@initialDom.fr yielded a null value</em></span><br><span style="font-size: 8pt;" data-mce-style="font-size: 8pt;"><em>2021-01-26 11:00:21,114 - - DEBUG [net.shibboleth.idp.attribute.resolver.ad.mapped.impl.MappedAttributeDefinition:185] - <strong>Attribute Definition mail: mapped dependency attribute value teststud@initialDom.fr to the values [StringAttributeValue{value=teststud@newDom.fr}]</strong></em></span><br><span style="font-size: 8pt;" data-mce-style="font-size: 8pt;"><em>2021-01-26 11:00:21,115 - - DEBUG [net.shibboleth.idp.attribute.resolver.AbstractAttributeDefinition:139] - Attribute Definition 'mail': produced an attribute with the following values [StringAttributeValue{value=teststud@newDom.fr}]</em></span><br><span style="font-size: 8pt;" data-mce-style="font-size: 8pt;"><em>2021-01-26 11:00:21,115 - - DEBUG [net.shibboleth.idp.attribute.resolver.impl.AttributeResolverImpl:335] - Attribute Resolver 'ShibbolethAttributeResolver': <strong>Attribute definition 'mail' produced an attribute with 1 values</strong></em></span></div><div><br data-mce-bogus="1"></div><div>Regards <br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>De: </b>"Nate Klingenstein" <ndk@signet.id><br><b>À: </b>"users" <users@shibboleth.net>, "users" <users@shibboleth.net><br><b>Envoyé: </b>Lundi 25 Janvier 2021 23:22:11<br><b>Objet: </b>RE: replace method in AttributeDefinition "ScriptedAttribute" getValues()<br></div><div><br></div><div data-marker="__QUOTED_TEXT__">Jehan,<br><br>Is there a reason you wouldn't just use a Mapped AttributeDefinition with regular expressions?<br><br>Anyway, I'm not aware of a way to change or remove attribute values in the ScriptedAttribute definition. I don't see a way in the quick read of the code.<br><br>https://git.shibboleth.net/view/?p=java-identity-provider.git;a=blob;f=idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScriptedIdPAttributeImpl.java<br><br>If you need a ScriptedAttribute for a specific reason, you could easily remove values in the attribute filter by a value match, or just use a new name for the attribute that you're adding the corrected value to, which will start as a null set.<br><br>Hope this is right,<br>Nate.<br>-- <br>For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg<br>To unsubscribe from this list send an email to users-unsubscribe@shibboleth.net<br></div></div></body></html>