<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div id="zimbraEditorContainer" style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000" class="10"><div>Hello<br></div><div><br data-mce-bogus="1"></div><div>Continuing in  my AttributeDefinitions for our specific SP Vendor (DocuSign, I changed the title from ScriptedAttribute to Mapped regarding previous reponses/Advices, cf thread below)  , </div><div>Now  I need to map a fixe accountID that must be unique for all users . So I wrote an attribute Definition to Map any values  [ (.+) ] of employeeNumber to a fixe value (ai4d...4224 , docusign accountID) like this ; <br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em><AttributeDefinition id="employeeNumber" xsi:type="Mapped"></em></span><br><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em>   <InputDataConnector ref="myLDAP" attributeNames="employeeNumber" /></em></span><br><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em>    <DefaultValue passThru="false"/></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>ai4dc9cfa7-dd39-aad1-884c-2f9b17574224</ReturnValue></em></span><br><span style="font-size: 10pt;" data-mce-style="font-size: 10pt;"><em>        <SourceValue caseSensitive="false">(.+)</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></div><div>This should work fine, unless there's no employeeNumber value at the source (Ldap) </div><div>How can I force that fixe ReturnValue even when the source value (which I don't care) is empty . <br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Thanks . </div><br><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>De: </b>"Jehan PROCACCIA" <jehan.procaccia@tem-tsp.eu><br><b>À: </b>"users" <users@shibboleth.net><br><b>Envoyé: </b>Mardi 26 Janvier 2021 11:54:24<br><b>Objet: </b>Re: replace method in AttributeDefinition "ScriptedAttribute" getValues()<br></div><br><div data-marker="__QUOTED_TEXT__"><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><br><div><span style="font-size: 10pt;"><em><AttributeDefinition id="mail" xsi:type="Mapped"></em></span><br><span style="font-size: 10pt;"><em>        <AttributeEncoder xsi:type="SAML1String"</em></span><span style="font-size: 10pt;"><em> name="urn:mace:dir:attribute-def:mail" /></em></span><br><span style="font-size: 10pt;"><em>        <AttributeEncoder xsi:type="SAML2String"</em></span><span 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;"><em>   <InputDataConnector ref="myLDAP" attributeNames="mail" /></em></span><br><span style="font-size: 10pt;"><em>    <DefaultValue passThru="true"/></em></span><br><span style="font-size: 10pt;"><em>    <ValueMap></em></span><br><span style="font-size: 10pt;"><em>        <ReturnValue>$1@<strong>newDom.fr</strong></ReturnValue></em></span><br><span style="font-size: 10pt;"><em>        <SourceValue>(.+)@<strong>initialDom.fr</strong></SourceValue></em></span><br><span style="font-size: 10pt;"><em>    </ValueMap></em></span><br><span style="font-size: 10pt;"><em>    <ValueMap></em></span><br><span style="font-size: 10pt;"><em>        <ReturnValue>$1@<strong>newDom.fr</strong></ReturnValue></em></span><br><span style="font-size: 10pt;"><em>        <SourceValue>(.+)@<strong>OtherinitialDom.fr</strong></SourceValue></em></span><br><span style="font-size: 10pt;"><em>    </ValueMap></em></span><br><span style="font-size: 10pt;"><em> </AttributeDefinition></em></span><br><br></div><div>Associated logs when using this mapped attribute : <br></div><br><div><span 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;"><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;"><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;"><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;"><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;"><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;"><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;"><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;"><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;"><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;"><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;"><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;"><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><br><div>Regards <br></div><br><hr id="zwchr"><div><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><br><div>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><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</div></div><div><br><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>De: </b>"Jehan PROCACCIA" <jehan.procaccia@tem-tsp.eu><br><b>À: </b>"users" <users@shibboleth.net><br><b>Envoyé: </b>Mardi 26 Janvier 2021 11:54:24<br><b>Objet: </b>Re: replace method in AttributeDefinition "ScriptedAttribute" getValues()<br></div><div><br></div><div data-marker="__QUOTED_TEXT__"><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><br><div><span style="font-size: 10pt;"><em><AttributeDefinition id="mail" xsi:type="Mapped"></em></span><br><span style="font-size: 10pt;"><em>        <AttributeEncoder xsi:type="SAML1String"</em></span><span style="font-size: 10pt;"><em> name="urn:mace:dir:attribute-def:mail" /></em></span><br><span style="font-size: 10pt;"><em>        <AttributeEncoder xsi:type="SAML2String"</em></span><span 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;"><em>   <InputDataConnector ref="myLDAP" attributeNames="mail" /></em></span><br><span style="font-size: 10pt;"><em>    <DefaultValue passThru="true"/></em></span><br><span style="font-size: 10pt;"><em>    <ValueMap></em></span><br><span style="font-size: 10pt;"><em>        <ReturnValue>$1@<strong>newDom.fr</strong></ReturnValue></em></span><br><span style="font-size: 10pt;"><em>        <SourceValue>(.+)@<strong>initialDom.fr</strong></SourceValue></em></span><br><span style="font-size: 10pt;"><em>    </ValueMap></em></span><br><span style="font-size: 10pt;"><em>    <ValueMap></em></span><br><span style="font-size: 10pt;"><em>        <ReturnValue>$1@<strong>newDom.fr</strong></ReturnValue></em></span><br><span style="font-size: 10pt;"><em>        <SourceValue>(.+)@<strong>OtherinitialDom.fr</strong></SourceValue></em></span><br><span style="font-size: 10pt;"><em>    </ValueMap></em></span><br><span style="font-size: 10pt;"><em> </AttributeDefinition></em></span><br><br></div><div>Associated logs when using this mapped attribute : <br></div><br><div><span 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;"><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;"><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;"><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;"><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;"><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;"><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;"><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;"><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;"><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;"><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;"><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;"><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><br><div>Regards <br></div><br><hr id="zwchr"><div><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><br><div>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><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</div><div><br></div></div></body></html>