Login method to login username and password
final String username = user;
final String password = pass;
AppservAccessController.doPrivileged(new PrivilegedAction() {
public java.lang.Object run() {
System.setProperty(ClientPasswordLoginModule.LOGIN_NAME,
username);
System.setProperty(ClientPasswordLoginModule.LOGIN_PASSWORD,
password);
return null;
}
});
// Since this is a private api and the user is not supposed to use
// this. We use the default the LoginCallbackHandler.
LoginContextDriver.doClientLogin(AppContainer.USERNAME_PASSWORD,
handler);