User guide

Appendix A: Samples of User Program Descriptions
A-2
DirContext ctx = new InitialDirContext(env);
Note
Carefully handle the administrator DN and password to protect the password from attack.
For measures that can be taken against password attack, refer to "Security Measures" under "Interstage
Single Sign-on" of "Security Risks" of “Security Risks and Measures“ in the Security System Guide.
Postprocessing (closing the connection with the repository)
Example
Close the connection between the sample program and the repository made by the pre-processing.
Use the result obtained by the common pre-processing as the value of "ctx".
ctx.close();
A user program to operate the SSO repository must be based on a correct design of the SSO repository
and created very carefully to prevent invalid SSO repository data from being created.
For details about the design of the SSO repository, see "Designing a SSO Repository".
Remarks
Knowledge of LDAP and the Java programming language are necessary prerequisites. If you are
using the Java API, refer to Java API specifications and other JAVA resources.
For details about the environment properties required for the pre-processing and other details on
application programming using the Java language, refer to "Creating an Application (JNDI)" in the
Smart Repository Operator’s Guide. The sample programs shown here exclude the package
notation of classes to be used and the handling of exceptions. The actual user programs must
include the following import declarations and exception processing:
Add the import declarations below.
import javax.naming.*;
import javax.naming.directory.*;
Add the exception processing below.
javax.naming.NamingException
Arrange the user program in the location that satisfies the operation, while fully considering security.
In addition, add any error-handling descriptions when it is needed.