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.propertiesorgfsecurity.propertiesfile, to configure for your particular security implementation. Examples:security-client-auth-init=mySecurity.UserPasswordAuthInit.createsecurity-peer-auth-init=myAuthPkg.myAuthInitImpl.createWhen you create your cache, pass any properties required by your security implementation to the cache factory create call by using one of these methods:
ClientCacheFactoryorCacheFactorysetmethods. Example:ClientCache clientCache = new ClientCacheFactory() .set("security-username", username) .set("security-password", password) .create();Properties object passed to the
ClientCacheFactoryorCacheFactorycreatemethod. These are usually properties of a sensitive nature that you do not want to put inside thegfsecurity.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 orgfsecurity.properties.
Close your cache when you are done, using the
closemethod of theClientCacheinstance or the inheritedclosemethod of theCacheinstance. Example:cache.close();