Skip Headers
Oracle® Access Manager Customization Guide
10g (10.1.4.2.0)

Part Number E10354-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

7 Useful Tools

Tools are available for you to use to make changes to the installed Oracle Access Manager files, such as parameter files and directories. This chapter discusses these tools. Topics include:

7.1 Text Editor

Oracle Access Manager operation is influenced by the content of various ASCII text files, in particular parameter files, also called *.xml files. These can be edited with a text editor.

Here are some guidelines to observe when editing these text files:

7.2 LDAP Tools

Directory applications use Lightweight Directory Access Protocol (LDAP) as a standard tool to create, modify and report data stored within the directory. Specific tools are available to allow relatively easy manipulation of this data directly, using LDAP.

This section provides a short introduction of these tools and methods for using them. More detail is available from the manufacturer of your server application, specifically for its version of these tools.

7.2.1 Viewing Directory Content in LDIF Files

The structure of a directory, and the data contained within it, is represented by the content of an LDAP Data Interchange Format (LDIF) file. The file can be output, the formatted result of a request made to the directory by an LDAP reporting tool, such as LDAPSEARCH. It can also be input, data that is intended for insertion to the directory, either as entirely new data, or as an update to existing data, using an updating tool such as LDAPMODIFY.

The following is an example, part of an LDIF file taken from an Oracle Access Manager Demo Directory:

dn: cn=John Kramer, ou=Sales, o=Company, c=US
objectclass: top
   objectclass: person
   objectclass: organizationalPerson
   objectclass: inetOrgPerson
   objectclass: companyOrgPerson
   cn: John Kramer
   sn: Kramer
   telephonenumber: 415-555-5269
   facsimiletelephonenumber: 415-333-1005
   title: Account Manager
   departmentnumber: 1204
   employeetype: Fulltime
   employeenumber: 521-321-4560
   givenname: John
   .
   .

7.2.2 Reporting Directory Content with LDAPSEARCH

LDAPSEARCH is one possible tool that can be used to report directory content. There are others, which use a different syntax, but the concepts are the same.

LDAPSEARCH can be used in either a command line or interactive mode. The command line approach is preferable, as it enables users to provide the text of the report request by means of a input file. It is easy to verify the content of this file before making the request. Errors are corrected by changing a few characters in the file rather than retyping the full request, which would be necessary in the interactive mode.

7.2.3 LDAPSEARCH Command Line Format

The command line format for LDAPSEARCH is:

  • ldapsearch(params)(filter) (attr_list)

  • Each of the three categories shown in italics between ( ) is optional; if all are omitted, LDAPSEARCH drops into interactive mode, which is not discussed here.

    The categories are as follows:

  • params: These parameters tell LDAPSEARCH how to operate. One of them, -f, is used to specify a filter file. If instead the search filter is provided on the command line, all parameters must be stated before the filter is stated.

  • filter: The filter instructs LDAPSEARCH to provide a subset of the data that would otherwise be provided. For example, a filter could require that only names beginning with N be reported. A filter provided on the command line must be enclosed within quotes.

  • attr_list: The attribute list, if included on the command line, overrides the default attribute listing. The default list shows all attributes belonging to the directory entry, except operational attributes. If you wish to see only some of these attributes listed, provide their names in the command line, following the filter and separated by spaces. If you want to see operational attributes, provide their names in the command line. If you follow the operational attributes with a * you get the default list of attributes as well.

7.2.3.1 LDAPSEARCH Command Line Parameters

Parameters are always provided in the form:

  • -p pdata

    where p is the parameter, preceded by a dash, and pdata is the information required for the parameter, if any. If the data contains a space, it must be completely enclosed in double quotes:

  • -p "pdata with spaces"

    Following is an alphabetical list of commonly used parameters. There are others. See the reference document for your version of LDAPSEARCH, or use the parameter /? to see them listed.

    -A: Tells the search to retrieve the attribute names only, not the attribute values.

    -b: Searchbase, the starting point for the search. The value specified here must be a distinguished name that is in the directory. Data provided for this parameter MUST be in double quotation marks. For example:

  • -b "cn=Barbara Jensen, ou=Development, o=Oracle.com"

    -D: Distinguished name of the server administrator, or other user authorized to search for entries. This parameter is optional if anonymous access is supported by your server. For example:

  • -D "uid=j.smith, o=Oracle.com"

    -f: Specifies the file containing the search filter(s) to be used in the search. For example:

  • -f filterfile

    -h: Hostname or IP address of the machine on which the directory server is installed. This entry is optional; if no hostname is provided, LDAPSEARCH uses the local host. For example:

  • -h myserver.com

    -H: This generates a list of all possible LDAPSEARCH parameters.

    -p: Port number that the directory server listens at. For example:

  • -p 1049

    -s: Scope of the search. The data provided for the scope must be one of the following:

    base: Search only the entry specified in the -b option.

    one: Search only the immediate children of the entry specified in the -b parameter; do not search the actual entry specified in the -b parameter.

    sub: Search the entry specified in the -b parameter, and all of its descendants. That is, perform a subtree search starting at the point identified in the -b parameter. This is the default, if the -s parameter is not used.

    -S: Designates the attribute(s) to use as sort criteria, controlling the order in which the results are displayed. You can use multiple -S arguments if you want to sort on multiple criteria. The default behavior is not to sort the returned entries. In the following example, the search results are sorted first by surname and then, within surname, by first name:

    -w: Password associated with the distinguished name that is specified in the -D option. If you do not specify this parameter, anonymous access is used. For example:

  • -S sn -S firstname

  • -w password

    -x: Specifies that the search results are sorted on the server rather than on the client. This is useful if you want to sort according to a matching rule, as with an international search. In general, it is faster to sort on the server than on the client.

    -z: Specifies the maximum number of entries to return in response to a search request. For example:

  • -z 1000

7.2.3.2 Examples

If you wanted to get the surname (sn), common name (cn), and given name for every employee within the sales organization whose given name is John, from the directory server listening at port 392, entirely from the command line, you could provide the following information:

ldapsearch -p 392 -b "ou=sales, o=company, c=US" -s sub "givenname=John" sn cn givenname

Results could be something like:

dn: cn=John Jackson, ou=Sales, o=Company, c=US sn: Jackson cn: John Jackson givenname: John dn: cn=John Kramer, ou=Sales, o=Company, c=US sn: Kramer cn: John Kramer givenname: John
dn: cn=John Jackson, ou=Sales, o=Company, c=US
sn: Jackson
   cn: John Jackson
   givenname: John
   dn: cn=John Kramer, ou=Sales, o=Company, c=US
   sn: Kramer
   cn: John Kramer
   givenname: John

You can get the same results by using a filter file. For example, a file called namejohn containing the filter:

givenname=John

can be used, with the command line being the following:

ldapsearch -p 392 -b "ou=sales, o=company, c=US" -s sub -f namejohn sn cn givenname

7.2.4 Changing Directory Content with LDAPMODIFY

LDAPMODIFY is a tool that can be used to change or add directory content. There are others, but the concepts are similar.

LDAPMODIFY opens a connection to the specified server, using the distinguished name and password you supply, and modifies the entries based on LDIF update statements contained in a specified file. LDAPMODIFY can also be run in interactive mode, a method that is not discussed here.

If schema checking is active when you use LDAPMODIFY, the server performs schema checking for the entire entry before applying it to the directory. If the directory server detects an attribute or object class in the entry that is not known to the schema, then the entire modify operation fails. Also, if a value for a required attribute is not present, the modify operation fails. Failure occurs even if the value for the problem object class or attribute is not being modified.

Note:

Turn on schema checking at all times, as a matter of good practice, to avoid accidently adding data to the directory that could later be unusable or cause schema violations when schema checking is turned back on. Schema checking is controlled at the directory administration server console and is generally on by default.

7.2.4.1 LDAPMODIFY Command Line Format

The command line format for LDAPMODIFY is:

ldapmodify <params>

Note:

The params category is optional; if it is omitted, LDAPMODIFY drops into interactive mode, which will not be discussed here.

where (params)are parameters that tell LDAPMODIFY how to operate. One of them, -f, can be used to specify a file describing modifications to be made to the directory.

7.2.4.2 LDAPMODIFY Command Line Parameters

Parameters are always provided in the form:

  • -p pdata

    where p is the parameter, preceded by a dash and followed by a space, and pdata is the information required for the parameter, if any. If the data contains a space, it must be completely enclosed in double quotes:

  • -p "pdata with spaces"

    Following is an alphabetical list of commonly used parameters. There are others. Use the parameter /? to see them listed.

    -c: Forces the utility to run in continuous operation mode. Errors are reported, but the utility continues with modifications. Default is to quit after reporting an error.

    -a: Enables you to add LDIF entries to the directory without requiring the changetype:add LDIF update statement, which is necessary in the interactive mode. This provides a simplified method of adding entries to the directory; in particular, this enables you to directly add a file created by LDAPSEARCH and modified to make changes.

    -D: The distinguished name of the server administrator or other user authorized to change directory entries. This parameter is optional if anonymous access is supported by your server. For example:

  • -D "uid=j.smith, o=Oracle.com"

    -f: Provides the name of the file containing the LDIF update statements used to define the directory modifications. For example:

  • -h mozilla

  • -f changestomake.txt

    -h: Hostname or IP address of the machine on which the directory server is installed. This entry is optional; if no hostname is provided, LDAPSEARCH uses the local host. For example:

    -H: Lists all possible LDAPMODIFY parameters.

    -p: Port number that the directory server uses. For example:

  • -p 1049

    -w: Password associated with the distinguished name that is specified in the -D option. If you do not specify this parameter, anonymous access is used. For example:

  • -w password

7.2.4.3 Examples

Suppose you want to change the stored given name of John Kramer, as reported under the discussion of LDAPSEARCH. The data reported back was:

dn: cn=John Kramer, ou=Sales, o=Company, c=US
   sn: Kramer
      cn: John Kramer
      givenname: John

This output can be used to derive an input file, ToHarvey, whose content might be:

dn: cn=John Kramer, ou=Sales, o=Company, c=US
   changetype:modify
      replace:givenname
      givenname: Harvey

The command line would then be:

ldapmodify - p 392 -f ToHarvey

If you were to now search the directory with the command line:

ldapsearch -p 392 -b "ou=sales, o=company, c=US" -s sub "givenname=Harvey" sn cn givenname

The response would be:

dn: cn=John Kramer, ou=Sales, o=Company, c=US
   sn: Kramer
   cn: John Kramer
   givenname: Harvey

7.3 XML/XSL Editors

The following are some links to editors that might be useful in working with XML and XSL files:

7.4 XSL Validation

Oracle recommends you thoroughly validate XSL stylesheets before using them in production. The following are freeware validators:

All three tools will parse and check for syntax errors. The second two do the better job of listing and locating syntax errors, while the first most closely approximates Oracle Access Manager's XSLT processor.

7.5 Troubleshooting Example

The Identity System uses the Xalan/Xerces XSLT processor. The Xalan processor is orders of magnitude faster than the built-in XSLT engine.

Suppose you add templates derived from basic.xsl to a custom xslStyleFunctions.xsl and both are included in almost any customized stylesheet). In this case, Xalan may report a number of problems, including an inability to resolve any of the oblix:ObScript/oblix:ObValue/. This results in empty JavaScript includes, for example:

<script="JavaScript" xml:space="preserve"\
</script>
<script="JavaScript" xml:space="preserve"\
</script>
...
<script="JavaScript" xml:space="preserve"\
</script>

The XSLT standard does not impose requirements on how processors should handle template conflict resolution. As a result, the XMLSPY internal processor does not report errors. However, Xalan would and the Identity System returns a stylesheet processing error.

In this case, there was a conflict due to multiple same-name templates sharing the same priority. A good description of template priorities can be found at:

The following two procedures prepare you to troubleshoot Xalan-specific stylesheet processing errors reported by the Identity System within XMLSPY.

To use XMLSPY with Xalan/Xerces on Windows 2000 and higher

  1. Download a Xalan-C 1.7.0 binary distribution, which is not compatible with Xerces-C 2.5.0 distribution.

  2. Download a Xerces-C 2.4.0 binary distribution.

  3. Unzip the downloaded archives.

    For example:

    C:\opt

  4. Navigate to your system PATH variable.

    For example:

    From the Control Panel select System, from System select Advanced, from Advanced select Env Vars, from Env Vars select System Variables, from System Variables select Path.

  5. Append the following to your system PATH variable:

    C:\opt\xml-xalan\c\Build\Win32\VC6\Release;C:\opt\xerces-c2_4_0-windows_nt-msvc_60\bin;

  6. Configure XMLSPY to use an external XSL processor, as discussed next.

To configure XMLSPY to use an external XSL processor

  1. From the Tools menu choose Options, fro m options choose XSL.

  2. Restart XMLSPY to pick up the newly updated PATH.

  3. Select External XSL transformation program.

  4. In the text box, enter Xalan.exe -o %2 %1 %3

  5. Click OK.