Writing a Signon PeopleCode Program

In addition to creating a default user and enabling public access, you also must write a Signon PeopleCode program that:

  • Uses data within the HTTP request to determine the real user ID.

    Your web server authentication system should be configured to insert the USERID of an authenticated user into the HTTP request as a header, a form field, or cookie.

  • Creates or updates the local copy of the user profile within the PeopleSoft database.

The programs developed to perform this task vary depending on where the web server inserted the user ID in the HTTP request and where the user profiles are stored. For example, some systems use an HTTP header to store the user ID, while others use cookies or form fields.

If the web server security product uses LDAP as a backend data store for user profiles, you can reuse some of the LDAP authentication PeopleCode to copy the profile from LDAP to the local database. The user profile may also be stored in another database, or a Windows domain registry. In either case, you must write PeopleCode to retrieve the value and make a local copy.

Note:

You can’t use the LDAP Authentication PeopleCode program as delivered. This program performs LDAP authentication and copies the user profile from an LDAP directory to the local database. You can, however, use the code that copies the profile from the directory, as a template for the code you need in this case.

The following is sample PeopleCode with the External_Authentication function. It is a simple example of retrieving the user ID from a form field named UserID:

/*//////////////////////////////////////////////*/
Function External_Authentication()
   /*  This application server "trusts" the authentication⇒
 performed by the web server */
   /*  retrieve the USERID from the HTTP request⇒
 and pass it to SetAuthentication Result */
   &UserID = %Request.GetParameter("UserID");
   SetAuthenticationResult( True, &UserID, "", False);
End-Function;

After you have written the program, you must set the Signon PeopleCode program to run only if authentication is successful. On the Signon PeopleCode page, you set the running as follows:

  • Clear the Exec Auth Fail check box; it must not be selected.

    You want this PeopleCode to run only if the connection to the application server originates from a web server that presents a valid user ID and password. In this case, the user ID is PUBUSER and the associated password. You should only select the Exec Auth Fail check box when the PeopleCode itself authenticates the user, not when the program relies on the web server to perform authentication.

  • You must set Invoke as to a user profile that has the appropriate roles and permissions to do all the operations in the External_Authentication function.

    For example, if External_Authentication creates a local copy of the user profile using the User Profile component interface, signon_peoplecode_user must have permission to use this component interface. The Signon PeopleCode program runs under the signon_peoplecode_user user ID.

Note:

Before running the PeopleCode, the application server authenticates the User ID and Password field values in the Public Users section of the Web Profile Configuration - Security page.