change case to Title case in IdP

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

change case to Title case in IdP

ljayaweera@gmail.com
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 [hidden email]
Reply | Threaded
Open this post in threaded view
|

RE: change case to Title case in IdP

Cameron Kerr

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 <[hidden email]> On Behalf Of Lalith Jayaweera
Sent: Tuesday, 29 May 2018 5:27 PM
To: Shib Users <[hidden email]>
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 [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: change case to Title case in IdP

ljayaweera@gmail.com
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 <[hidden email]> 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 <[hidden email]> On Behalf Of Lalith Jayaweera
Sent: Tuesday, 29 May 2018 5:27 PM
To: Shib Users <[hidden email]>
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 [hidden email]


--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: change case to Title case in IdP

Peter Schober
In reply to this post by ljayaweera@gmail.com
* Lalith Jayaweera <[hidden email]> [2018-05-29 07:27]:
> Currently we got the user name stored in Upper case in the source system
> (e.g. LDAP)

That's where you'd need to fix it, in the source system.

> We want to change that into title case in the attribute resolver and
> pass it to SPs

You can't. There's no algorithm in the world that can get the case
correct in all, well, cases. There are too many cultural and regional
conventions involved (MacBla, Macbla, Mc Bla, De La Foo, De la Foo,
van der Foo, Van Foo, etc.pp.) -- ignoring the case (ha!) or non-latin
script completely for now -- and people are somewhat picky when it
comes to messing up their names.
(They're probably used to the specific messing up you've done so far
in ALL CAPS as they realize that's not how the name is supposed to be
spelled.)

So save yourself that trouble of implementing a "quick fix" downstream
that doesn't in fact fix anything, and start recording case properly
at the source systems.

-peter
--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: change case to Title case in IdP

IAM David Bantz
+1 %-]

On Fri, Jun 1, 2018 at 3:57 AM, Peter Schober <[hidden email]> wrote:
* Lalith Jayaweera <[hidden email]> [2018-05-29 07:27]:
> Currently we got the user name stored in Upper case in the source system
> (e.g. LDAP)

That's where you'd need to fix it, in the source system.

> We want to change that into title case in the attribute resolver and
> pass it to SPs

You can't. There's no algorithm in the world that can get the case
correct in all, well, cases. There are too many cultural and regional
conventions involved (MacBla, Macbla, Mc Bla, De La Foo, De la Foo,
van der Foo, Van Foo, etc.pp.) -- ignoring the case (ha!) or non-latin
script completely for now -- and people are somewhat picky when it
comes to messing up their names.
(They're probably used to the specific messing up you've done so far
in ALL CAPS as they realize that's not how the name is supposed to be
spelled.)

So save yourself that trouble of implementing a "quick fix" downstream
that doesn't in fact fix anything, and start recording case properly
at the source systems.

-peter
--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to [hidden email]


--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

RE: [EXTERNAL] Re: change case to Title case in IdP

O'Quinn, Dennis

Hi, can someone tell me how to just get the returned NameID (i.e., at the SP) converted to lowercase?

 

I have no control over how the data is stored or presented to me, it comes in uppercase, and, I just need to change it to lowercase before passing it off to the application.

 

Will the “<AttributeResolver type="LowerCase" source="NameID" />” directive do that for me (running Shibboleth 2.6.1).

 

Thanks, Dennis

 

Dennis O’Quinn | EDW Infrastructure Engineering | NAE115H @ 2250 MTC

The Home Depot | Marietta Technology Center | 2250 Newmarket Parkway | Marietta, GA  30067

(: Direct: 470.689.4513 | Cell: 470.658.1183 | Internal: 24513

*: [hidden email]

 

 

 

From: users <[hidden email]> On Behalf Of IAM David Bantz
Sent: Friday, June 1, 2018 1:32 PM
To: Shib Users <[hidden email]>
Subject: [EXTERNAL] Re: change case to Title case in IdP

 

+1 %-]

 

On Fri, Jun 1, 2018 at 3:57 AM, Peter Schober <[hidden email]> wrote:

* Lalith Jayaweera <[hidden email]> [2018-05-29 07:27]:
> Currently we got the user name stored in Upper case in the source system
> (e.g. LDAP)

That's where you'd need to fix it, in the source system.

> We want to change that into title case in the attribute resolver and
> pass it to SPs

You can't. There's no algorithm in the world that can get the case
correct in all, well, cases. There are too many cultural and regional
conventions involved (MacBla, Macbla, Mc Bla, De La Foo, De la Foo,
van der Foo, Van Foo, etc.pp.) -- ignoring the case (ha!) or non-latin
script completely for now -- and people are somewhat picky when it
comes to messing up their names.
(They're probably used to the specific messing up you've done so far
in ALL CAPS as they realize that's not how the name is supposed to be
spelled.)

So save yourself that trouble of implementing a "quick fix" downstream
that doesn't in fact fix anything, and start recording case properly
at the source systems.

-peter
--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to [hidden email]

 




The information in this Internet Email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this Email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this Email are subject to the terms and conditions expressed in any applicable governing The Home Depot terms of business or client engagement letter. The Home Depot disclaims all responsibility and liability for the accuracy and content of this attachment and for any damages or losses arising from any inaccuracies, errors, viruses, e.g., worms, trojan horses, etc., or other items of a destructive nature, which may be contained in this attachment and shall not be liable for direct, indirect, consequential or special damages in connection with this e-mail message or its attachment.

--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

RE: [EXTERNAL] Re: change case to Title case in IdP

O'Quinn, Dennis

Hi, FYI, I finally got a response from my IdP guys and they were able to convert it to lowercase on their end.  No need to convert on the SP end.

 

Thanks, Dennis

 

Dennis O’Quinn | EDW Infrastructure Engineering | NAE115H @ 2250 MTC

The Home Depot | Marietta Technology Center | 2250 Newmarket Parkway | Marietta, GA  30067

(: Direct: 470.689.4513 | Cell: 470.658.1183 | Internal: 24513

*: [hidden email]

 

 

 

From: users <[hidden email]> On Behalf Of O'Quinn, Dennis
Sent: Friday, June 1, 2018 2:16 PM
To: Shib Users <[hidden email]>
Subject: RE: [EXTERNAL] Re: change case to Title case in IdP

 

Hi, can someone tell me how to just get the returned NameID (i.e., at the SP) converted to lowercase?

 

I have no control over how the data is stored or presented to me, it comes in uppercase, and, I just need to change it to lowercase before passing it off to the application.

 

Will the “<AttributeResolver type="LowerCase" source="NameID" />” directive do that for me (running Shibboleth 2.6.1).

 

Thanks, Dennis

 

Dennis O’Quinn | EDW Infrastructure Engineering | NAE115H @ 2250 MTC

The Home Depot | Marietta Technology Center | 2250 Newmarket Parkway | Marietta, GA  30067

(: Direct: 470.689.4513 | Cell: 470.658.1183 | Internal: 24513

*: [hidden email]

 

 

 

From: users <[hidden email]> On Behalf Of IAM David Bantz
Sent: Friday, June 1, 2018 1:32 PM
To: Shib Users <[hidden email]>
Subject: [EXTERNAL] Re: change case to Title case in IdP

 

+1 %-]

 

On Fri, Jun 1, 2018 at 3:57 AM, Peter Schober <[hidden email]> wrote:

* Lalith Jayaweera <[hidden email]> [2018-05-29 07:27]:
> Currently we got the user name stored in Upper case in the source system
> (e.g. LDAP)

That's where you'd need to fix it, in the source system.

> We want to change that into title case in the attribute resolver and
> pass it to SPs

You can't. There's no algorithm in the world that can get the case
correct in all, well, cases. There are too many cultural and regional
conventions involved (MacBla, Macbla, Mc Bla, De La Foo, De la Foo,
van der Foo, Van Foo, etc.pp.) -- ignoring the case (ha!) or non-latin
script completely for now -- and people are somewhat picky when it
comes to messing up their names.
(They're probably used to the specific messing up you've done so far
in ALL CAPS as they realize that's not how the name is supposed to be
spelled.)

So save yourself that trouble of implementing a "quick fix" downstream
that doesn't in fact fix anything, and start recording case properly
at the source systems.

-peter
--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to [hidden email]

 

 



The information in this Internet Email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this Email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this Email are subject to the terms and conditions expressed in any applicable governing The Home Depot terms of business or client engagement letter. The Home Depot disclaims all responsibility and liability for the accuracy and content of this attachment and for any damages or losses arising from any inaccuracies, errors, viruses, e.g., worms, trojan horses, etc., or other items of a destructive nature, which may be contained in this attachment and shall not be liable for direct, indirect, consequential or special damages in connection with this e-mail message or its attachment.




The information in this Internet Email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this Email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this Email are subject to the terms and conditions expressed in any applicable governing The Home Depot terms of business or client engagement letter. The Home Depot disclaims all responsibility and liability for the accuracy and content of this attachment and for any damages or losses arising from any inaccuracies, errors, viruses, e.g., worms, trojan horses, etc., or other items of a destructive nature, which may be contained in this attachment and shall not be liable for direct, indirect, consequential or special damages in connection with this e-mail message or its attachment.

--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to [hidden email]