Attributes Invoking External Scripts

Liam Hoekenga liamr at umich.edu
Fri Aug 8 16:13:16 EDT 2014


>
> Unfortunately another script I need to invoke for another attribute is
> a Perl script.


Why not rewrite the perl script in a supported language?  You'll be better
of in the long run.

On Thu, Aug 7, 2014 at 3:25 PM, Jason <shibboleth at happycat.org.uk> wrote:

> Does anyone have an example of some ecmascript I can use in the
> scripted attribute that would invoke an external script?
>


You can do it in jython..

    val =
os.popen("TLS_CACERT=/usr/local/shibboleth-idp/credentials/ldap.pem
/usr/bin/ldapsearch -H %s -D %s -w '%s' -LLL -b '%s' '%s' dn |
/usr/bin/perl -p0e 's/\n //g'|sort -u" % ( ldap_server, ldap_user,
ldap_pass, s_base, s_filter )).readlines()

    for i in val:
        m = re.search( r'.+(cn=.*)', i.rstrip(), re.IGNORECASE)
        if m is None:
            continue
        else:
            serviceGroupMembership.getValues().add( m.group(1) )


Liam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/users/attachments/20140808/a78edb21/attachment-0001.html 


More information about the users mailing list