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:
- 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
- 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.
- 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
- 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:
- The type parameter of <storage> points to the Json storage configuration class JsonStorageSetting that extends the implementation
- <type> specifies the type of storage configuration, which should be set to CUSTOM when using extended storage
- <outputDirectory> specifies the specific location where json is stored on the local disk