##### Using LDAP server security information via the LDAP implementation of the Security API

JReport Server can access an LDAP server directly using the LDAP Security API implementation. To achieve this, you will need to turn on the LDAP security providers. There are three approaches to achieve this:

- Configuring on the JReport Administration page

  You must be a member of the administrators role in order to access the JReport Administration page. To use the LDAP security providers, on the JReport Administration page, click Configuration > LDAP > Server, then check Enable Direct Authentication to LDAP Server.

- Configuring by API method

  Invoke the following two methods in the interface ConfigurationLDAPServer:

      /**
      * Specifies whether or not the Server security system uses the LDAP providers.
      * @return Returns true if using none imported LDAP support, otherwise returns false.
      */
      public boolean isEnableNoneImportedLDAPSupport();
      /**
      * Specifies whether or not the Server security system uses none imported LDAP support.
      * @param isEnableNoneImportedLDAPSupport Set this parameter to true if the Server
      security system uses none imported LDAP support, otherwise set it to false.
      */
      public void setEnableNoneImportedLDAPSupport (boolean isEnableNoneImportedLDAPSupport);

- Editing the LDAP XML configuration file

  Specify the following property in the LDAP XML configuration file:

  `<env-enableNoneImportedLDAPSupport>true</env-enableNoneImportedLDAPSupport>`.

  If the value is true, JReport Server security system will then use the LDAP providers. The default value of this property is false.

Note: In order to use LDAP providers, a valid admin user is required to manage the JReport Server. The following are rules for checking whether or not a user is an admin user:

- Whether or not the user is a member of the LDAP admin group. The LDAP admin group is a configuration option in the LDAP configuration XML file.
- Whether or not the user is a member of the administrators role. The user can be granted the role by a role map.

A user that meets one of these two rules is regarded as an admin user, and is thus allowed to access the JReport Administration page.

###### Troubleshooting LDAP configuration

If you encountered any problems during LDAP configuration, refer to the following for help.

LDAP configuration failure resulting in re-login failure as an admin user

An admin user may fail to carry out LDAP configuration properly, and thus then cannot log onto the JReport Administration page to manage the server. If this happens, you should follow the below steps:

1. Modify the property in the LDAP configuration XML file LDAPProperties.xml in `<install_root>\properties` as follows to turn off the Enable Direct Authentication to LDAP Server option:

   `<env-enableNoneImportedLDAPSupport>false</env-enableNoneImportedLDAPSupport>`

2. Restart JReport Server and log in as a built-in security admin user to correct the LDAP configuration.

Warning messages in the advent of incorrect LDAP configuration

Apart from the notes offered on the JReport Administration page > Configuration > LDAP panel, prompt warning information is also provided in order to cope with incorrect LDAP configuration. The server system will prompt warning messages in the following cases:

- If you do not fill in the Admin Group field or specify an admin group.
- If the admin group specified does not hold a user.
- If the admin group specified does not exist in the LDAP server.