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

JReport Enterprise 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. At the same time, the Enable Auto-Import of Users from LDAP Server and Import LDAP Group(s) To options are hidden.

- 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 Enterprise 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 Enterprise 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 below to turn off the Enable Direct Authentication to LDAP Server option:

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

2. Restart JReport Enterprise 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 in the LDAP tab of the JReport Administration > Configuration page, 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.