LDAP Roxen modules


This document discusses the following topics:

© Honza Petrous, v1.3



Description

This modules allows Roxen RXML programmers to access and manipulate an LDAP based Directory.

There are two LDAP related modules:

  • LDAP tag module
    This module enables new RXML tags: LDAP, LDAPOUTPUT, LDAPFOR, LDAPELSE.

  • LDAP user authentication module
    This module allows authenticate users with LDAP server.


LDAP tag

Tag <LDAP> Executes an LDAP operation, but doesn't do anything with the result. This is useful if you do operation like ADD or MODIFY.

The following attributes are used:

  • dn (REQUIRED)
    The value of DN for operation.

  • op (REQUIRED)
    The mode operation of access the directory.

    Valid values are "add","delete","modify" and "replace".

  • host
    The hostname of the machine the LDAP-server runs on.

  • user
    The name of the user to access the directory with.

  • password
    The password to access the directory.

  • basedn
    The base DN to access the directory.

  • attr
    The attributes for operation.
                         (attr_name1:['value1'[,...]])[(...)]
    	    

    Example: attr="(cn:'Super User')(mail:'post@ahoy.org','root@bla.cz')(ou:)"


LDAPOUTPUT tag

Tag <LDAPOUTPUT> Executes an LDAP search operation and replaces '#'-quoted attributes with the results. Second, third, ... attribute value can be specified by suffix ":n" before trailing '#'.

The following attributes are used:

  • filter (REQUIRED)
    The filter for search operation.

  • host
    The hostname of the machine the LDAP-server runs on.

  • user
    The name of the user to access the directory with.

  • password
    The password to access the directory.

  • basedn
    The base DN to access the directory.

  • scope
    The scope to access the directory.

    Valid values are "base", "onelevel" and "subtree".

  • parse
    If specified, the filter will be parsed by the RXML-parser

Special attribute names are:

  • dn
    gets DN of entry.

  • labeledURIAnchor
    gets anchor tag from attribute "labeledURI"

  • labeledURIuri
    gets URI part of attribute "labeledURI"

  • labeledURIlabel
    gets label part of attribute "labeledURI"

'#' is quoted as ##. The content inbetween <LDAPOUTPUT> and </LDAPOUTPUT> is repeated once for every DN in the result.

LDAPFOR tag

Tag <LDAPFOR> Repeats content of tag for multiple attribute value.

WARNING:Usable only in <LDAPOUTPUT> tag !

Variable quoted by '#' is replaced by value.

The following attributes are used:

  • attr (REQUIRED)
    The parsed attribute name.

  • index
    The initial index value. Index starts from 1.
    Default value is 1 (from first value).
  • step
    The increment value for index.
    Default value is 1 (index=index+1).
  • max
    If specified, "max" value is returned.


LDAPELSE tag

Tag <LDAPELSE> is executes only if error ocurred with last <LDAP> or <LDAPOUTPUT> tags.

Content is parsed and variable #ldaperror# is replaced with last error message.


LDAP user authentication

This module allows authenticate users against LDAP server. You must disable default User authentication module before you will be enable this module.

Module works in two modes:

  1. guest mode

    This mode is destined for 'first-time' players with LDAP authentication. In this case you must provide the LDAP account with read permission for the whole subtree.

    WARNING: The guest mode with all-read permissions is possible security risk and is recommended for testing environment only.

  2. user mode

    ... under constuction ..., sorry ;)