04 Documentation updates
Administrator Client, Server
Enabling Java API options for authenticated invocation
The following Java/CORBA class (lotus.domino package) elements support sign-on to Domino and WebSphere servers in a Single Sign-on domain.
getSessionToken method
Gets a session token for enabling sign-on to Domino and WebSphere servers in a domain that supports Single Sign-on.
NOTE: This method is new with R5.0.5.
Defined in
Session
Data type
String
Syntax
public String getSessionToken()
throws NotesException
public String getSessionToken(String serverName)
throws NotesException
Parameter
String serverName
The name of a server configured for Single Sign-on. If the server name is not specified, the code must execute on a server configured for Single Sign-on.
Return value
String
Usage
The token is unique for each user and is valid for the time specified in the Domino Directory. The format of the token is consistent with the LtpaToken cookie used by WebSphere.
You can also get the token from the HTTP headers in a servlet with HttpServletRequest.getCookies().
NotesFactory class
NOTE: To make remote (IIOP) calls to the Domino Objects in a WebSphere environment, NCSOW.jar must be in your classpath. This is new with R5.0.4.
The description of the NotesFactory class is extended as follows.
NOTE: These extensions are new with R5.0.5.
To access a server using Single Sign-on, create a Session object as follows. For remote (IIOP) calls, the first parameter is the Internet name of the host. For local calls, the first parameter is null.
- createSession(hostString, String token) - Access is granted based on the token. This method works in a Domino environment. The token must be a valid token for Single Sign-on obtained from Session.getSessionToken or the LtpaToken cookie used by WebSphere.
- createSession(hostString, org.omg.SecurityLevel2.Credentials) - Access is based on the Credentials object. This method works in a WebSphere environment where the Credentials object is created using loginHelper.
- createSession(hostString, null) - Access is granted based on the current Credentials object in the WebSphere environment. This method works from an Enterprise JavaBeans (EJB) application in WebSphere.
The specification of NotesFactory is extended with the following methods:
static public Session createSession(String host, String token)
throws NotesException
static public Session createSession(String host, org.omg.SecurityLevel2.Credentials)
throws NotesException
Examples
Example #1
This Domino agent gets a token for Single Sign-on and creates a remote (IIOP) session to another server based on the token. The agent runs on the server containing the token.
import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
Session s2 = NotesFactory.createSession("test5.irish.com",
session.getSessionToken());
System.out.println("remote session name = " + s2.getUserName());
} catch(Exception e) {
e.printStackTrace();
}
}
}
Example #2
This Domino agent gets a token for Single Sign-on and creates a remote (IIOP) session to a server based on the token. The agent runs a Notes client.
import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
Session s2 = NotesFactory.createSession("test5.irish.com",
session.getSessionToken("test5.irish.com"));
System.out.println("remote session name = " + s2.getUserName());
} catch(Exception e) {
e.printStackTrace();
}
}
}