Related information
The source code files used to implement the sample application are contained in testIdentityToken.ear and may be used as a model for creating your own applications.
The class com.ibm.identitytoken.IdentityTokenTest is a servlet in the sample application. After the application is deployed, the source code file for the IdentityTokenTest servlet is found in your profile under the installedApps directory at testIdentityToken.ear/testIdentityTokenWeb.war/WEB-INF/source/com/ibm/identityToken/IdentityTokenTest.java. Take note of these important design features of the IdentityTokenTest servlet when implementing your own application.
- An profile variable of type String and named sourceApplicationID is set in the init() method of the IdentityTokenTest servlet. This variable is later used with the setSourceApplicationID() method of a ConnectionSpecImpl object to uniquely identify the application to EIM. When implementing your own applications, use a convention of your own devising to assign a unique SourceApplicationID.
- Once an identity token is generated, it is used to create a com.ibm.as400.access.AS400 object which is stored in an HTTPSession object immediately after the AS400 object is used to execute the OS/400 system command on the selected host system. The important point here is that only the AS400 object persists across requests to the server, not the IdentityToken object. The benefits of this are much better performance for subsequent requests and no worries about the identity token expiring.
Related Links