### Customized implementation of the security API

JReport Enterprise Server provides a set of security APIs which you can implement in order to build your preferred security system.

The following sections discuss the basic rules and implementation of the security API:

- Partial Implementation of the security API
- Implementing the security API using an .xml file
- Rules for applying customized security API

Notes:

- For details about the security APIs, see the jet.server.api.custom.security package in JReport Enterprise Server Javadoc in `<install_root>\help\server\en\api`.
- Demo references available in `<install_root>\help\server\en\samples`:
  - DemoAuthenticationProvider.java
    Demo for implementation of the jet.server.api.custom.security.AuthenticationProvider interface.
  - DemoAuthorizationProvider.java
    Demo for implementation of the jet.server.api.custom.security.AuthorizationProvider interface.
- In V8, two new methods addSecurityListener() and isEnableEdit() are added into the API jet.server.api.custom.security.AuthenticationProvider. If you have upgraded JReport Enterprise Server from V7 to V8, and have applied customized implementation of AuthenticationProvider in V7, you need implement the new methods in the API.
- JReport Enterprise Server provides the ability to use customized user authentication scheme by the implementation of the two interfaces jet.server.api.custom.security.AuthenticationProvider and jet.server.api.custom.security.AuthorizationProvider. In addition, the way of implementing the deprecated security API interface jet.server.userman.UserAuthenticator is also supported and you can refer to the following demos for reference, which are located in `<install_root>\help\server\en\samples`:
  - If you want to use JReport Enterprise Server as a servlet in your system, see Demo1UserAuthenticator.java.
  - If you want to use your user data, you need load your data in the structural method. See Demo2UserAuthenticator.java, Demo2Realm.java, Demo2User.java and demo2data.txt for reference.