 Apache Geode
  
    CHANGELOG
  Apache Geode
  
    CHANGELOG
  
        
  Managing a Cache in a Secure System
To create a cache in a secured system, authentication at connection time will require credentials. Authorization permits operations as configured.
These steps demonstrate a programmatic cache creation.
- To create the cache: - Add necessary security properties to the - gemfire.propertiesor- gfsecurity.propertiesfile, to configure for your particular security implementation. Examples:- security-client-auth-init=mySecurity.UserPasswordAuthInit.create- security-peer-auth-init=myAuthPkg.myAuthInitImpl.create
- When you create your cache, pass any properties required by your security implementation to the cache factory create call by using one of these methods: - ClientCacheFactoryor- CacheFactory- setmethods. Example:- ClientCache clientCache = new ClientCacheFactory() .set("security-username", username) .set("security-password", password) .create();
- Properties object passed to the - ClientCacheFactoryor- CacheFactory- createmethod. These are usually properties of a sensitive nature that you do not want to put inside the- gfsecurity.propertiesfile. Example:- Properties properties = new Properties(); properties.setProperty("security-username", username); properties.setProperty("security-password", password); Cache cache = new CacheFactory(properties).create();- Note: Properties passed to a cache creation method override any settings in either the - gemfire.propertiesfile or- gfsecurity.properties.
 
 
- Close your cache when you are done, using the - closemethod of the- ClientCacheinstance or the inherited- closemethod of the- Cacheinstance. Example:- cache.close();