ldap-as-a-datasource demonstrates using the ldap Translator to access data in OpenLDAP Server.
-
OpenLDAP be installed on Red Hat Linux 6.x(Red Hat document, Community document)
To start the server, open a command line and navigate to the "bin" directory under the root directory of the Teiid server and run:
./standalone.sh //For Linux
standalone.bat //for WindowsIf Teiid isn’t configured in the default configuration, append the following arguments to the command to specify the configuration -c {configuration.file}
./standalone.sh -c standalone-teiid.xmlFor installing OpenLDAP on Red Hat Linux 6.x please refer to Steps for adding Group and Users , in this section we will create a Group HR and 3 users(hr1, hr2, hr3) under it.
run the following CLI script
cd $JBOSS_HOME/bin
./jboss-cli.sh --connect --file={path}/ldap-as-a-datasource/src/scripts/setup.cli
NOTE - Before executing setup.cli, either modify setup.cli change {ldap.url} to LDAP url, {ldap.rootdn} to LDAP root Distinguished Name and {ldap.rootpw} to LDAP root password, or set System Properties ldap.url point to LDAP url, ldap.rootdn point to LDAP root Distinguished Name and ldap.rootpw to LDAP root password.
Copy the following files to the "/standalone/deployments" directory
src/vdb/ldap-vdb.xml src/vdb/ldap-vdb.xml.dodeploy
Open the admin console(http://localhost:9990/console) to make sure the VDB is deployed. See Query Demonstrations below to demonstrate query.
-
Change your working directory to "${quickstart.install.dir}/simpleclient"
-
Use the simpleclient example to run the following queries:
Example: mvn exec:java -Dvdb="ldapVDB" -Dsql="select * from HR_Group"
|
Note
|
depending on your OS/Shell the quoting/escaping required to run the example can be complicated. It would be better to install a Java client, such as SQuirreL, to run the queries. |