<div dir="ltr">Hi all,<br><br>I would like to strip the multi-value mail attribute (urn:mace:dir:attribute-def:mail) we're receiving from an IDP and only use the first value found.<br><br>For example:<br><br>- if the mail attribute is a multi-value: <a href="mailto:Jordan.Belfort@harvard-example.edu">Jordan.Belfort@harvard-example.edu</a>;<a href="mailto:jordan@harvard-example.edu">jordan@harvard-example.edu</a> , then only return <a href="mailto:Jordan.Belfort@harvard-example.edu">Jordan.Belfort@harvard-example.edu</a><br>- if the mail attribute is a single value: <a href="mailto:s1869831907@example.org">s1869831907@example.org</a> , then only return <a href="mailto:s1869831907@example.org">s1869831907@example.org</a><br><br>I thought I could fix that with the Transform AttributeResolver, but it didn't gave me the correct results. This is what I've tried:<br><br><AttributeResolver type="Transform" source="Shib-email"><br>    <Regex match="^([\w\.@-]+)" dest="mymail1">$1</Regex><br></AttributeResolver><br><br>Result for "<a href="mailto:s1869831907@example.org">s1869831907@example.org</a>":<br>mymail1:<br>(yes, empty result)<br><br>Result for "<a href="mailto:Jordan.Belfort@harvard-example.edu">Jordan.Belfort@harvard-example.edu</a>;<a href="mailto:jordan@harvard-example.edu">jordan@harvard-example.edu</a>":<br>mymail1:<br>(yes, also empty)<br><br>First I thought it had something to do with my regex, so I've tried many different ones. They all worked with online regex testers based on Java.<br>But with Shibboleth, the results were all empty.<br>So I've changed the output from $1 to |$1| to see what happens:<br><br><AttributeResolver type="Transform" source="Shib-email"><br>    <Regex match="^([\w\.@-]+)" dest="mymail">$1</Regex><br>    <Regex match="^([\w\.@-]+)" dest="mymail1">|$1|</Regex><br></AttributeResolver><br><br>Result for "<a href="mailto:s1869831907@example.org">s1869831907@example.org</a>":<br>mymail: <br>mymail1: |<a href="mailto:s1869831907@example.org">s1869831907@example.org</a>|<br><br>Result for "<a href="mailto:Jordan.Belfort@harvard-example.edu">Jordan.Belfort@harvard-example.edu</a>;<a href="mailto:jordan@harvard-example.edu">jordan@harvard-example.edu</a>":<br>mymail: <br>mymail1: |<a href="mailto:Jordan.Belfort@harvard-example.edu">Jordan.Belfort@harvard-example.edu</a>|;|<a href="mailto:jordan@harvard-example.edu">jordan@harvard-example.edu</a>|<br><br>Ok, the output is now visible, even if I replace the | character with a space.<br>But still not the first value if the mail attribute consist of more than one value.<br><br>What am I doing wrong here?<br><br>Best regards,<br>Wesley</div>