Extending the security information storage

Feedback


iServer defaults to storing security information in the SQLite database and supports MySQL/Oracle database storage. If the above storage methods can not meet the demand, you can customize the storage of user information based on security information storage APIs (Storage and CustomSecurityInfoStorageSetting) provided by iServer.

This section will use json storage security information as an example to introduce you the basic process of security information storage extension.

Extended basic process:

  1. Implement json storage interface (JsonStorage)

Realize a custom storage, such as a database, or a local file xml storage. In this case, the security information is stored in the local json file

  1. Implement the storage configuration class (JsonStorageSetting)

Implement the storage configuration class. In this case, it is used to specify the json storage configuration, including disk storage location, etc.

  1. Compile code

The extension code is compiled and exported as a JAR package (see: Extend_SecirityInfo.jar), and copy the JAR file to the [SuperMap iServer installation directory]/webapps/iserver/WEB-INF/lib folder

  1. Configuration Use

In the iServer system configuration file ([SuperMap iServer installation directory]\ webapps\iserver\WEB-INF\iserver-system.xml), configure the extended json storage. Action: Open the system configuration file, add the following configuration information in the <security> node under <management>:

<storage class="com.supermap.server.config.JsonStorageSetting"> 
        <type>CUSTOM</type>  
        <outputDirectory>./WEB-INF</outputDirectory>  
        <impl>com.supermap.services.security.storages.JsonStorage</impl> 
</storage>

Where: