User guide
A-1
Appendix A
Samples of User Program Descriptions
This appendix provides examples of user programs developed with Java that are used to operate the
SSO repository.
• Registering a Role Configuration in the SSO Repository
• Registering User Information in the SSO Repository
• Deleting User Information from the SSO Repository
• Adding a User Role
• Deleting a User Role
• Displaying the User Lock Status
• Displaying the User Validity Period
• Changing the User Validity Period
• Changing the User Password
When other user programs to operate the SSO repository are required, create the required user
programs based on the description examples below.
All the above processing requires common preprocessing and postprocessing. Each user processing
must be inserted between the pre-processing and post processing programs.
The common processing programs are explained below.
Pre-processing (opening the connection with the repository)
Example
Connect the sample program below to the host named "ssohost" using port number "389" in the security
level "simple."
Specify the administrator DN and password as Java strings in the "bindDn" and "password" parameters,
respectively.
java.util.Hashtable env = new java.util.Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://ssohost:389");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, bindDn);
env.put(Context.SECURITY_CREDENTIALS, password);