NCache 4.6 - Online Documentation

Configuring Security for Cache

 
Security can also be configured on the cache itself. This can be done as follows:
 
Using NCache Manager
 
  • Go to Security menu option and select Security Credentials option.
 
 
  • Security Credentials dialog will open.
 
 
  • Provide the valid credentials for your active directory like name of Domain Controller, Port (optional), User Name and Password.
 
 
  • Click on the Verify Credentials button. It will prompt success or failure messages. If provided security credentials are correct then it will display the success message like this:
 
 
  • Click OK.
 
  • Go to the NCache Manager ->Security tab.
 
 
 
  • Expand the domain users under the Available Domain Users section.
 
 
  • Add required users to Selected Users section using ‘>’ button. These users will have access for cache operations.
 
 
  • Check Enable Security check box.
 
 
  • Select users from the users list and then add the required users using ‘>’ button. These users will be allowed to manage the caches.
 
 
  • Check the Enable Security checkbox to enable the security.
 
Right click on the cache name in Cache Explorer and select Apply Configuration option.
 
Using Command Line Tool
 
  • Open command prompt.
 
  • Go to the NCache tools directory: cd %NCHOME%/bin/tools
 
  • Using configurecachesecurity.exe, provide the required information:  
configurecachesecurity demoClusteredCache /E /s 20.200.21.95 /U james_tredwell /P yourpassword /C yourdomain.org
 
  • Press ENTER, it will enable security for demoClusteredCache on server 20.200.21.95 and add the user james_tredwell.
 
  • If you want to add more users, use the following command after step 2:
      configurecachesecurity demoClusteredCache /A /N aaron_finch /s 20.200.21.95 /U  administrator /P yourpassword /C   yourdomain.org
 
  • Press ENTER. It will add the user aaron_finch to the secured users list of demoClusteredCache.
 
 
How to pass Security Credentials to API:
 
User can also pass security credentials to API from the application using the following code:
 
  CacheInitParams ciParam = new CacheInitParams();
        ciParam.PrimaryUserCredentials = new SecurityParams("primaryUserId", "primaryUserPassword");
        ciParam.SecondaryUserCredentials = new SecurityParams("secondaryUserId", "secondaryUserPassword");
 
        Cache cache = NCache.InitializeCache("myreplicatedcache", ciParam);
 
 
See Also