InfoCenter Home >
5: Securing applications -- special topics >
5.4: Overview: Using programmatic and custom logins >
5.4.1: Client-side login >
5.4.1.2: The LoginHelper class

5.4.1.2: The LoginHelper class

The LoginHelper class is a WebSphere-provided utility class that provides wrappers around CORBA security methods. It can be used by pure Java clients that need the ability to programmatically authenticate users but don't need to use the authentication data on the client side.

The methods in this class give a client program a way to collect authentication information from a user and package it to be sent to a server. The server authenticates the user and returns security credentials to the client.

The following list summarizes the public methods in the LoginHelper class. The source file is installed at:

<installation_root>/hosts/default_host/examples/security/LoginHelper.java
and the class file is installed at:
<installation_root>/servlets/LoginHelper.class

LoginHelper()
The constructor obtains a new security-context object from the underlying ORB. This object is used to carry authentication information and resulting credentials for the client.

Syntax:
LoginHelper() throws IllegalStateException
login()
This method takes the user's authentication data (identifier and password), authenticates the user (validates the authentication data), and returns the resulting Credentials object.

Syntax:
org.omg.SecurityLevel2.Credentials login(String userID, String password)
throws IllegalStateException
setInvocationCredentials()
This method sets the specified credentials so that all future methods invocations will occur under those credentials.

Syntax:
void setInvocationCredentials(org.omg.SecurityLevel2.Credentials invokedCreds)
throws org.omg.Security.InvalidCredentialType,
org.omg.SecurityLevel2.InvalidCredential
getInvocationCredentials()
This method returns the credentials under which methods are currently being invoked.

Syntax:
org.omg.SecurityLevel2.Credentials getInvocationCredentials()
throws org.omg.Security.InvalidCredentialType
getUserName()
This method returns the user name from the credentials in a human-readable format.

Syntax:
String getUserName(org.omg.SecurityLevel2.Credentials creds)
throws org.omg.Security.DuplicateAttributeType,
org.omg.Security.InvalidAttributeType
Go to previous article: The TestClient Go to next article: Server-side login

 

 
Go to previous article: The TestClient Go to next article: Server-side login