This chapter provides overviews of the common functions that reference a password data store and the interactive flow for a sign on password data store. This chapter also provides details of the common functions.
Note. This chapter is intended for use by programmers.
The common functions discussed in this chapter can be combined to reference a password database store. These functions can help achieve a sign on point between the portal and other target system software.
For each target system (email, web-based, and so forth), the user ID and password are stored and usually encrypted. When attempting to access information through PeopleSoft Enterprise Portal features that need to retrieve information from these target systems, such as the Email pagelet, the PeopleSoft Enterprise Portal performs the connection to the system using the user credentials stored in the password data store.
Note. This is a one-way integration. No data is written to the target system, such as Microsoft Exchange. A login is performed and data is retrieved, but user credentials or data is never updated in the target system.
The PeopleSoft Enterprise Portal uses these functions for third-party email and calendar integration:
InsertUpdateUsrNamePsswd.
Used for inserting and updating.
GetUsrNamePsswd.
Returns the user name and password that are associated with a Uniform Resource Locator (URL) identifier and a portal user ID.
DeleteUsrNamePsswd.
Used for deleting.
For example, when accessing the Email pagelet, the Get function is called. It retrieves the user credentials from the data store, which can then be passed to the target system. The Insert/Update is used when the user sets up the pagelet for the first time, or subsequently updates his user ID or password. The Delete is used when the user deletes these stored credentials from the password data store.
See Also
Setting Up Third-Party Email and Calendar
The following diagram illustrates a way in which the InsertUpdateUsrNamePsswd, GetUsrNamePsswd, and DeleteUsrNamePsswd common functions could be used.
Interactive flow for a sign on password data store
This section discusses the common functions used to reference a password data store.
Syntax
InsertUpdateUsrNamePsswd(URL_ID, EO_PE_USER_NAME, EO_PE_PASSWORD)
Description
InsertUpdateUsrNamePsswd takes the URL identifier (URL_ID) and the portal user ID (PRTL_USER_ID) and searches the table for an entry that already exists. If an entry exists, an update is performed; if no entry exists, a new entry is inserted.
The values for the user ID (EO_PE_USER_NAME) and password (EO_PE_PASSWORD) that are associated with the URL_ID and PRTL_USER_ID are encrypted when placed in the table.
The following is the technical design in PeopleCode:
Function InsertUpdateUsrNamePsswd(&URL_ID, &EO_PE_USER_NAME, &EO_PE_PASSWORD) &found = ""; &PRTL_USER_ID = %UserId; &EO_PE_USER_NAME = Encrypt("", &EO_PE_USER_NAME); &EO_PE_PASSWORD = Encrypt("", &EO_PE_PASSWORD); SQLExec("select EO_PE_USER_NAME from PS_EO_PE_SS_LOGIN where URL_ID = :1 and PRTL_USER_ID = :2", &URL_ID, &PRTL_USER_ID, &found); If &found = "" Then SQLExec("INSERT INTO PS_EO_PE_SS_LOGIN( URL_ID, PRTL_USER_ID, EO_PE_USER_NAME, EO_PE_PASSWORD) values(:1, :2, :3, :4)", &URL_ID, &PRTL_USER_ID, &EO_PE_USER_NAME, &EO_PE_PASSWORD); Else SQLExec("UPDATE PS_EO_PE_SS_LOGIN SET EO_PE_USER_NAME = :1, EO_PE_PASSWORD = :2 WHERE URL_ID = :3 AND PRTL_USER_ID = :4", &EO_PE_USER_NAME, &EO_PE_PASSWORD, &URL_ID, &PRTL_USER_ID); End-If; End-Function;
Parameters
URL_ID |
URL identifier. |
EO_PE_USER_NAME |
User name that is needed to access the account that is referenced by the URL_ID. |
EO_PE_PASSWORD |
Password that is associated with the EO_PE_USER_NAME. |
Returns
The function returns no value.
Example
In this example, the function is used with hardcoded values. In most cases, variables are used as parameters.
InsertUpdateUsrNamePsswd("Yahoo_Mail_Account", "Name", "Password");
Name and password are encrypted and placed in the table. The table appears as follows:
URL_ID |
PRTL_USER_ID |
EO_PE_USER_NAME |
EO_PE_PASSWORD |
Yahoo_Mail_Account |
Portal Login Name |
ASDFG#$%MDSF |
ASKDKFJ@W#$RFGMS |
Syntax
GetUsrNamePsswd(URL_ID, EO_PE_USER_NAME, EO_PE_PASSWORD);
Description
GetUsrNamePsswd takes the URL_ID and PRTL_USER_ID and searches the table for the associated EO_PE_USER_ID and EO_PE_PASSWORD. GetUsrNamePsswd decrypts EO_PE_USER_ID and EO_PE_PASSWORD. The decrypted user ID and password are passed back.
The following is the technical design in PeopleCode:
Function GetUsrNamePsswd(&URL_ID, &EO_PE_USER_NAME, &EO_PE_PASSWORD) &PRTL_USER_ID = %UserId; SQLExec("select EO_PE_USER_NAME, EO_PE_PASSWORD from PS_EO_PE_SS_LOGIN where URL_ID = :1, and PRTL_USER_ID = :2", &URL_ID, &PRTL_USER_ID, &EO_PE_USER_NAME, &EO_PE_PASSWORD); &EO_PE_USER_NAME = Decrypt("", &EO_PE_USER_NAME); &EO_PE_PASSWORD = Decrypt("", &EO_PE_PASSWORD); End-Function;
Parameters
URL_ID |
URL identifier. |
EO_PE_USER_NAME |
Empty variable that is used to store the value for the user name that is associated with the URL_ID. The decrypted value can be retrieved from the function without using a return. |
EO_PE_PASSWORD |
Empty variable that is used to store the value for the password that is associated with the URL_ID. The decrypted value can be retrieved from the function without using a return. |
Returns
The function returns no value.
Example
The value for URL_ID is hardcoded. Usually, this parameter is a variable.
&UserName = "";
&Password = "";
GetUsrNamePsswd("Yahoo_Mail_Account", UserName, Password);
Syntax
DeleteUsrNamePsswd(&URL_ID);
Description
DeleteUsrNamePsswd deletes entries in the table by searching with the URL_ID and the PRTL_USER_ID and removing those items when it finds a match.
The following is the technical design in PeopleCode:
Function DeleteUsrNamePsswd(&URL_ID) &PRTL_USER_ID = %UserId; SQLExec("Delete from PS_EO_PE_SS_LOGIN Where URL_ID = :1 and PRTL_USER_ID = :2", &URL_ID, &PRTL_USER_ID); End-Function;
Parameters
URL_ID |
URL identifier. |
Returns
The function returns no value.
Example
In this example, the value for URL_ID is hardcoded. Usually, this parameter is a variable.
DeleteUsrNamePsswd("Yahoo_Mail_Account");