Connecting to a Remote RAD Instance and Authenticating in Java

When connecting to a remote instance, no implicit authentication is performed. The connection is not established until you authenticate. The com.oracle.solaris.rad.client package provides a utility class (RadAuthHandler) which can be used to perform a PAM login. If you provide a locale, username and password, authentication is non-interactive. If locale is null, then C is used.

The following example shows how to connect to a TCP instance on port 7777.

Example 2-16 Java Language – Creating Remote RAD Connection Over TCP IPv4 on Port 7777

import com.oracle.solaris.rad.client.RadAuthHandler;
import com.oracle.solaris.rad.connect.Connection;

Connection con = Connection.connectTCP("host1", 7777);
System.out.println("Connected: " + con.toString());
RadAuthHandler hdl = new RadAuthHandler(con);
hdl.login("C", "user", "password"); // First argument is locale
con.close();

RAD is deployed as two cooperating processes. A proxy process is responsible for authentication and establishing communications. A slave process is created by the proxy and handles module processing. A slave is created for each client connection.