setRemoteUser()

The sysLib.setRemoteUser() system function sets the userid and password for calls from Java™ programs to remote programs or to remote EGL services or to remote IBM® i programs that are accessed by way of a native binding.
Authorization may be required when the linkage options part, callLink element, remoteComType property has one of the following values:

Authorization is based on non-blank values that are passed to sysLib.setRemoteUser().

If a value is blank or not specified, EGL looks for that value in the csouidpwd.properties file, which includes the properties CSOUID (for the user ID) and CSOPWD (for the password). In general, the order of precedence for different sources of security credentials is the EGL deployment descriptor (for service access), sysLib.setRemoteUser(), csouidpwd.properties, and (for access by JAVA400J2C), the application server. If you do not specify security credentials in any way, EGL makes the call without a user name or password.

Before it invokes sysLib.setRemoteUser(), your code can issue Java access functions that display a dialog box to prompt the user for the user ID and password. You can use one or both values in csouidpwd.properties as a default that takes effect when the user does not provide this information.

Syntax

  sysLib.setRemoteUser(
    userID STRING in,
    password STRING in)
userID
The user ID on the remote system.
password
The password on the remote system. This password is encrypted automatically if you pass a string literal to the function. For more information, see Encrypting passwords.

Example

setRemoteUser("jfred", "p0w1d2");

Compatibility

Table 1. Compatibility considerations for setRemoteUser()
Platform Issue
COBOL generation The sysLib.setRemoteUser() function is not supported
JavaScript generation The sysLib.setRemoteUser() function is not supported

Feedback