package gov.nih.nci.calab.service.login;

import gov.nih.nci.calab.dto.security.SecurityBean;
import gov.nih.nci.security.AuthenticationManager;
import gov.nih.nci.security.SecurityServiceProvider;
import gov.nih.nci.security.exceptions.CSException;

/** 
 * The LoginService authenticates users into the calab system.
 * 
 * @author      doswellj
 * @param applicationName sets the application name for use by CSM
 * @param am  Authentication Manager for CSM.
 */

public class LoginService 
{

	String applicationName = null;
	AuthenticationManager am = null;
	
// TODO Make a singleton 

	
	/**
	 * LoginService Constructor
	 * @param strname name of the application
	 */

	public LoginService(String strname) throws Exception 
	{
		this.applicationName = strname;
		am = SecurityServiceProvider.getAuthenticationManager(this.applicationName);
        //TODO Add Role implementation
	 }
	
	/**
	 * The login method uses CSM to authenticated the user with LoginId and Password credentials 
	 * @param	strusername  LoginId of the user
	 * @param 	strpassword  Encrypted password of the user
	 * @return	boolean identicating whether the user successfully authenticated
	 */
	public boolean login(String strUsername, String strPassword ) throws CSException 
	{
		return am.login( strUsername,strPassword);
	}
	
	/**
	 * The userInfo method sets and authenticated user's information 
	 * @param	strLoginId LoginId of the authenticated user
	 * @return	SecurityBean containing an authenticated user's information
	 */
    public SecurityBean setUserInfo(String strLoginId)
    {
    	//TODO Implement method to query CSM_USER table and get logged in user's recordset
    	SecurityBean securityBean = new SecurityBean();
    	
    	securityBean.setLoginId(strLoginId);
    	//set remaining info
    	
    	return securityBean;
    	
    }
	
}

@@ -64,33 +64,27 @@
 lab.dto.
-security.Security
+common.User
 Bean;%0Aim
@@ -1513,24 +1513,20 @@
  public 
-Security
+User
 Bean set
@@ -1652,24 +1652,20 @@
 et%0A    %09
-Security
+User
 Bean sec
@@ -1680,24 +1680,20 @@
 n = new 
-Security
+User
 Bean();%0A

Use UserBean to replace SecurityBean