code: private void loginUser(final String userId, final String password, final BooleanCallback callback) {
  		LoginRequest request = new LoginRequest();
  		request.setLogin(userId);
  		request.setPassword(password);
  		GwtCommand command = new GwtCommand(loginCommandName);
  		command.setCommandRequest(request);
  		GwtCommandDispatcher.getInstance().execute(command, new AbstractCommandCallback<LoginResponse>() {
  
  			public void execute(LoginResponse loginResponse) {
  				if (loginResponse.getToken() == null) {
  					if (callback != null) {
  						callback.execute(false);
  					}
  					manager.fireEvent(new LoginFailureEvent(loginResponse.getErrorMessages()));
  				} else {
  					userToken = loginResponse.getToken();
  					Authentication.this.userId = userId;
  					UserDetail userDetail = GwtCommandDispatcher.getInstance().getUserDetail();
  					userDetail.setUserId(loginResponse.getUserId());
  					userDetail.setUserName(loginResponse.getUserName());
  					userDetail.setUserOrganization(loginResponse.getUserOrganization());
  					userDetail.setUserDivision(loginResponse.getUserDivision());
  					userDetail.setUserLocale(loginResponse.getUserLocale());
  					if (callback != null) {
  						callback.execute(true);
  					}
  					manager.fireEvent(new LoginSuccessEvent(userToken));
  				}
  			}
  		});
  	}
docs: Effectively log in a certain user.