The com.ibm.as400.security.auth package provides classes that allow user profile swapping using IBM i profile token and credential classes when using the AS400 connection class.
If you are using JDBC you can call the Security-related APIs to adopt profiles on the connection.
- Get Profile Handle (QSYGETPH) validates a user ID and password, and creates an encrypted abbreviation called a profile handle for that user profile.
- Set Profile Handle (QWTSETP) switches the job to run under a new profile.
- Generate Profile Token (QSYGENPT) verifies that the caller has authority to generate a profile token for the requested profile and then generates a profile token.
- Set To Profile Token (QSYSETPT) validates the profile token and changes the current thread to run under the user and group profiles represented by the profile token.