1 | Profile token | Output | Char(32) |
2 | User profile name | Input | Char(10) |
3 | User password | Input | Char(*) |
4 | Time out interval | Input | Bin(4) |
5 | Profile token type | Input | Char(1) |
6 | Error code | I/O | Char(*) |
7 | Length of user password | Input | Bin(4) |
8 | CCSID of user password | Input | Bin(4) |
The Generate Profile Token (OPM, QSYGENPT) API verifies that the caller has authority to generate a profile token for the requested profile and then generates a profile token. This profile token can be passed to one or more additional processes which can then use it to perform tasks on behalf of the authenticated user.
The Generate Profile Token API follows this process:
You cannot obtain a profile token for the following system-supplied user profiles:
QAUTPROF QDLFM QMSF QSNADS QTSTRQS QCLUMGT QDOC QNETSPLF QSPL QCOLSRV QDSNX QNFSANON QSPLJOB QDBSHR QFNC QNTP QSRVAGT QDBSHRDO QGATE QPEX QSYS QDFTOWN QLPAUTO QPM400 QTCP QDIRSRV QLPINSTALL QRJE QTFTP
The maximum number of profile tokens that can be generated is approximately
2,000,000; after that, the space to store them is full. Message CPF4AAA is sent
to the application, and no more profile tokens can be generated until one is
removed.
The profile token that is generated.
The name of the user for which to generate the profile token.
The password of the user for which to generate the profile token or a special value.
Password of the user
Special value
*NOPWD | The user requesting the profile token must have *USE authority to the user
profile.
A profile token does not get created for a disabled user profile. A profile token does not get created for a user profile with an expired password. This value is not allowed if the name of the currently running profile is specified for the user profile name parameter. |
*NOPWDCHK | The user requesting the profile token must have
*USE authority to the user profile.
If the profile is disabled, the user requesting the profile token must have *ALLOBJ and *SECADM special authorities to get a token. If the password is expired, the user requesting the profile token must have *ALLOBJ and *SECADM special authorities to get a token. |
*NOPWDSTS | The user requesting the profile
token must have *USE authority to the user profile.
A profile token does not get created for a disabled user profile. If the password is expired, the user requesting the profile token must have *ALLOBJ and *SECADM special authorities to get a token. |
The time before the profile token times out.
You can specify one of the following values:
-1 | Use system default value (3600 seconds) |
1-3600 | Time out value in seconds. |
The type of the profile token to be generated.
You can specify one of the following values:
1 | Single-use profile token. A single-use profile token can be used only on the Set To Profile Token (QSYSETPT; QsySetToProfileToken) API once and cannot be used to generate new profile tokens. |
2 | Multiple-use profile token. A multiple-use profile token can be used on the Set To Profile Token (QSYSETPT; QsySetToPrfTkn) API an unlimited number of times, but cannot be used to generate new profile tokens. |
3 | Multiple-use, regenerable profile token. A multiple-use, regenerable profile token can be used on the Set To Profile Token (QSYSETPT; QsySetToPrfTkn) API an unlimited number of times and can be used to generate a new single-use, multiple-use, or multiple-use, regenerable profile token. |
The structure in which to return error information. For the format of the structure, see Error Code Parameter.
This parameter group is required when specifying a password for the password parameter. It is not allowed when specifying a special value.
The length, in bytes, of the password contained in the user password parameter.
The valid values are:
1-512 | The length of the password in the user password parameter. |
The CCSID of the user password parameter. For a list of valid CCSIDs, see the Globalization topic in the iSeries Information Center.
The valid values are:
-1 | The current password level for the system is used to determine the CCSID of the password data. When calling this API on password level 0 or 1, CCSID 37 is used. When calling this API on password level 2 or 3, the default CCSID (DFTCCSID) job attribute is used. See usage notes for more details. |
0 | The CCSID of the job is used to determine the CCSID of the data to be converted. If the job CCSID is 65535, the CCSID from the default CCSID (DFTCCSID) job attribute is used. |
1-65533 | A valid CCSID in this range. |
The CCSID parameter on this API can lead to potential problems if coded with inconsistent CCSID values. Passwords created using the CRTUSRPRF, CHGUSRPRF, and CHGPWD CL commands, as well as the QSYCHGPW API (when called without passing the CCSID parameter), while the system is running password level 0 or 1 are created using CCSID 37. Passwords created using these CL commands and the QSYCHGPW API (without the CCSID parameter specified) when running password level 2 or 3 are created using the default job CCSID. Using variant characters $, @ and #, as well as other variant characters, in a user password may result in inconsistencies when converting from one CCSID to another. When calling this API on password level 0 or 1, CCSID 37 should be specified unless the password string is in a known CCSID. When calling this API on password level 2 or 3, pass the default job CCSID unless the password string is in a known CCSID.
Message ID | Error Message Text |
---|---|
CPF2204 E | User profile &1 not found. |
CPF2213 E | Not able to allocate user profile &1. |
CPF2225 E | Not able to allocate internal system object. |
CPF227F E | *NOPWD not allowed for current user. |
CPF22E2 E | Password not correct for user profile &1. |
CPF22E3 E | User profile &1 is disabled. |
CPF22E4 E | Password for user profile &1 has expired. |
CPF22E5 E | No password associated with user profile &1. |
CPF22E9 E | *USE authority to user profile &1 required. |
CPF3BC7 E | CCSID &1 outside of valid range. |
CPF3BDE E | CCSID &1 not supported by API. |
CPF3C1D E | Length specified in parameter &1 not valid. |
CPF3C3C E | Value for parameter &1 not valid. |
CPF3C36 E | Number of parameters, &1, entered for this API was not valid. |
CPF3C90 E | Literal value cannot be changed. |
CPF3CF1 E | Error code parameter not valid. |
CPF4AAA E | Maximum number of profile tokens have been generated. |
CPF4AAB E | Time out value not valid. |
CPF4AAD E | Profile token type not valid. |
CPF4AB8 E | Insufficient authority for user profile &1. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
Top | Security APIs | APIs by category |