Secure Client Example

The security framework establishes trust between members, and also authorizes cache operations from clients based on that trust. You establish trust by verifying credentials when one process connects to another. New members connect to the locator in a peer-to-peer topology, providing credentials to the locators. Clients connect to cache servers, providing credentials to the servers. One system connects to another in a multi-site system, using mutual authentication.

Running the Example

The example shows a very simple client/server configuration that uses security. The server starts on a port with security properties for client requests. The client does puts and gets on the server with valid PUT credentials. The client uses the valid LDAP username and password.

Note: To run this example, you must have terminal sessions configured for the QuickStart examples, as described in Setting Up Your Environment.

  1. In one session, start the server:

    $ java quickstart.SecurityServer ldap ou=ldapTesting,dc=pune,dc=gemstone,dc=com
  2. In the other session start the client:

    $ java quickstart.SecurityClient gemfire6 gemfire6
    
  3. # Follow the instructions on the screens. When the client exits, press Enter to stop the server.

Example Source Files

Program and cache configuration files for the client and the server:

Table 1. Cache configuration files, located in $SamplesDirectory/quickstart/xml
SecurityServer.xml Configures a cache to serve caching clients. The example region also is configured with a loader.
SecurityClient.xml Configures a region as a client region in a Security cache.
Table 2. Java program files, located in $SamplesDirectory/quickstart/quickstart
SecurityServer.java A server that starts on a port with security properties for client requests.
SecurityClient.java Does put and get on the server with valid PUT credentials. This client uses the valid LDAP username and password.
Related Topics
Security

Related Javadocs