Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] psp (not pspng) need to replace ':' with something else

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] psp (not pspng) need to replace ':' with something else


Chronological Thread 
  • From: Jeffrey Crawford <>
  • To: Andrew Morgan <>
  • Cc: Gouper Users List <>
  • Subject: Re: [grouper-users] psp (not pspng) need to replace ':' with something else
  • Date: Fri, 30 Jun 2017 14:24:53 -0700
  • Ironport-phdr: 9a23:Xs4QtBb/uyHuz5a1wBc0xtX/LSx+4OfEezUN459isYplN5qZpsW5bnLW6fgltlLVR4KTs6sC0LWG9f24EUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i76xXcoFx7+LQt4IPjuUs6X1pzvlrP6x5qGSgNEnjeiKZZ1Nhq/q02Fs84MjoJkAqEr0QePr3dVLbd432RtcHCekRjm69b414Rq7CpXof5po8xNX6vgcrUzZaFTFz9gPmwosp64/SLfRBeCsyNPGl4dlQBFVk2ctEn3

okay the script method, fair enough I'll take what I can get :) thanks Andy

Jeffrey E. Crawford
Enterprise Service Team
    ^         ^
   / \  ^    / \    ^
  /   \/ \  /   \  / \
 /        \/     \/   \
/                      \

You have been assigned this mountain to prove to others that it *can* be moved.

On Fri, Jun 30, 2017 at 2:22 PM, Andrew Morgan <> wrote:
On Fri, 30 Jun 2017, Jeffrey Crawford wrote:

Luckly we haven't gone too far using posix groups, but we've had at least
one system bark with posix names containing ':' in them. Is there a simple
way to have the psp create cn with something like '.' or '_' as a delimiter
as opposed to ':'? I know I could make a script but I was hoping there was
an easier way.

We do this for generating the samAccountName attribute in AD with the PSP. In psp-resolver.xml:

  <!-- Static data connector. -->
  <resolver:DataConnector
    id="StaticDataConnector"
    xsi:type="dc:Static">
...
    <!-- dummy attribute -->
    <dc:Attribute id="samAccountName">
      <dc:Value>dummy</dc:Value>
    </dc:Attribute>
  </resolver:DataConnector>

  <resolver:AttributeDefinition
        id="samAccountName"
        xsi:type="ad:Script"
        sourceAttributeID="groupNameInStem">
        <resolver:Dependency ref="StaticDataConnector" />
        <resolver:Dependency ref="groupNameInStem" />
        <ad:Script><![CDATA[
                samAccountName.getValues().clear(); // remove the dummy value
                if (groupNameInStem.getValues().size() > 0) {
                        // Strip the baseStem off the front
                        var regex = /^${edu.internet2.middleware.psp.baseStem}:/;
                        var tmp = new String(groupNameInStem.getValues().get(0));
                        var tmp2 = tmp.replace(regex, "");
                        samAccountName.getValues().add(tmp2.replace(/:/g,"_"));
                }
        ]]></ad:Script>
   </resolver:AttributeDefinition>


I forget why we had to create the dummy attribute...

        Andy




Archive powered by MHonArc 2.6.19.

Top of Page