change case to Title case in IdP
Lalith Jayaweera
ljayaweera at gmail.com
Tue May 29 21:36:04 EDT 2018
Thanks
yes planning the same above inside a for loop
e.g.
var arrayOfData = commonName.split("\\s+");
and loop through
but I was wondering whether any declarative solution via Regx
On Tue, May 29, 2018 at 9:23 PM, Cameron Kerr <cameron.kerr at otago.ac.nz>
wrote:
> Here’s something similar I have done for the ‘title’ attribute, which our
> LDAP stores as uppercase.
>
>
>
> Hope it helps.
>
>
>
> <AttributeDefinition xsi:type="ScriptedAttribute" id="title">
>
> <Dependency ref="MyLDAP" />
>
> <DisplayName xml:lang="en">Title</DisplayName>
>
> <AttributeEncoder xsi:type="SAML1String"
> name="urn:mace:dir:attribute-def:title" />
>
> <AttributeEncoder xsi:type="SAML2String" name="urn:oid:2.5.4.12"
> friendlyName="title" />
>
> <Script>
>
> <![CDATA[
>
> logger = Java.type("org.slf4j.LoggerFactory").getLogger("
> net.shibboleth.idp.attribute");
>
>
>
> if ( title.getValues().size() > 0 )
>
> {
>
> allUpper = title.getValues().get(0);
>
>
>
> titleCase = allUpper[0].toUpperCase() +
> allUpper.substring(1).toLowerCase();
>
>
>
> logger.debug("returning title as {}", titleCase);
>
> title.getValues().clear();
>
> title.getValues().add(titleCase);
>
> }
>
> ]]>
>
> </Script>
>
> </AttributeDefinition>
>
>
>
> *From:* users <users-bounces at shibboleth.net> *On Behalf Of *Lalith
> Jayaweera
> *Sent:* Tuesday, 29 May 2018 5:27 PM
> *To:* Shib Users <users at shibboleth.net>
> *Subject:* change case to Title case in IdP
>
>
>
> Hi,
>
> Currently we got the user name stored in Upper case in the source system
> (e.g. LDAP),
>
>
>
> We want to change that into title case in the attribute resolver and pass
> it to SPs
>
>
>
> What would be the easiest way to achieve this within attribute-resolver.
>
>
>
> Thanks
>
>
>
>
>
>
>
> --
> For Consortium Member technical support, see https://wiki.shibboleth.net/
> confluence/x/coFAAg
> To unsubscribe from this list send an email to
> users-unsubscribe at shibboleth.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20180530/41895a6c/attachment.html>
More information about the users
mailing list