Generate Profile Token Extended (QsyGenPrfTknE) API


  Syntax for QsyGenPrfTknE:
 #include <qsyptkn.h>

 void QsyGenPrfTknE
        (unsigned char  *Profile_token,
         char           *User_profile_name,
         char           *User_password,
         int             Length_of_user_password,
         unsigned int    CCSID_of_user_password,
         int             Time_out_interval,
         char            Profile_token_type,
         void           *Error_code);

  Service Program: QSYPTKN

  Default Public Authority: *USE

  Threadsafe: Yes


The Generate Profile Token Extended (QsyGenPrfTknE) 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.

This API requires the password for the profile to be specified. If you need to generate a profile token for a profile without specifying the password, see the Generate Profile Token (QsyGenPrfTkn) API.

The Generate Profile Token API follows this process:


Authorities and Locks

API Public Authority
*USE
User Profile Lock
*LSRD

Required Parameter Group

Profile token
OUTPUT; CHAR(32)

The profile token that is generated.


User profile name
INPUT; CHAR(10)

The name of the user for which to generate the profile token.


User password
INPUT; CHAR(*)

The password of the user for which to generate the profile token.

Special values are not allowed for this parameter.


Length of user password
INPUT; BINARY(4)

The length, in bytes, of the password contained in the user password parameter.

The valid values are:

CCSID of user password
INPUT; BINARY(4)

The CCSID of the user password parameter. For a list of valid CCSIDs, see the IBM i globalization topic collection.

The valid values are:


Time out interval
INPUT; BINARY(4)

The time before the profile token times out.

You can specify one of the following values:


Profile token type
INPUT; CHAR(1)

The type of the profile token to be generated.

You can specify one of the following values:


Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Usage Notes

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.


Error Messages



API introduced: V5R1

[ Back to top | Security APIs | APIs by category ]