ctf_authentication_manager
Version 23.x.0.0b

 INTRODUCTION

	1. The TeamForge Authentication Manager provides a GUI interface for managing TeamForge/JBoss authentication configuration, including creation, activation, deactivation, reordering, deletion and upgrade of profiles for LDAP, AD, Kerberos, LDAP Extended, Master Password and Teamforge Database etc.

	2. This addon syncs user info data like fullname, email, organization and status from LDAP/AD with CTF user(s) based on configuration.

	3. After installing this addon, CTF user will be able to create new account and login to CTF directly skipping admin approval and email verification by setting APPROVE_NEW_USER_ACCOUNTS as false in site options.

	4. CTF User with proper privilege will be able to sync a particular user from the CTF UI.

 PREAMBLE

  1. Make sure the /tmp directory doesn't have executable permission. Perl component should not use /tmp for storing the dependent binaries. All the dependent binaries should be present under /opt/cn-local/pdk/


 INSTALLATION

  This package is delivered as an RPM and will be installed in this directory:

    /opt/collabnet/teamforge/add-ons/ctf_authentication_manager


  IMPORTANT:

	1. Never deploy the authenticationManager.war and ldapsync.war via JBoss CLI.

	2. Deploying war files via JBoss CLI followed by JBoss restart/stop-start will cause JBoss Startup Issue as JBoss CLI will leave some residue while deploying war files.

	3. If you deploy authenticationManager.war and ldapsync.war via JBoss CLI (in some unavoidable circumstance), you have to undeploy the same via CLI before restarting/stopping JBoss to avoid JBoss startup issue.

	4. MasterPassword supports fips mode


  To complete the install do the following, with TeamForge and all services running:

        1) Navigate to the add-on installation directory:
                "cd /opt/collabnet/teamforge/add-ons/ctf_authentication_manager"

        2) Run the add-on installer:
		a) "./install"
		b) Permission for /opt/collabnet/teamforge/log/add-ons/ctf_authentication_manager_newuser_registration.log and /opt/collabnet/teamforge/log/add-ons/ctf_authentication_manager_selected_sync.log should be based on HTTPD user/group in runtime options.
		c) Use hide.sh script for hiding all the fields (except Retype Password) in new user creation page.
		d) Use show.sh script for showing all fields (including Fullname, Email, Locale, Timezone, License Type) in new user creation page.

		NOTE: Running hide.sh two times consecutively or running two times show.sh consecutively will throw an error in the command prompt.

		e) If site is upgraded from CTF7.x/8.0 to CTF8.1+ and if the site is hiding all the fields (except Retype Password) using hide.sh in new user creation page, then do the following

			1) Run show.sh
			2) Run hide.sh

		f) Important: Add 'add-ons' service to <APP_BOX>:SERVICES token in site-options.conf

	3) Stop Teamforge

	4) It is advisable to set APPROVE_NEW_USER_ACCOUNTS as false in site options without which the New User Creation will follow the core product admin approval/email verification and new user won't be created instantly and won't be logged into CTF directly.

        5) Do Teamforge provision

        6) Start TeamForge

	7) Restart Apache

        8) Additional possible steps:

                a) Configure SSL Certificate

                        If the authentication server you will be configuring TeamForge to query is SSL protected, please add the CA chain and/or the server certificate to the java jre keystore/truststore. The default location is in {JDK_HOME or JAVA_HOME}/jre/lib/security/cacerts or jssecerts.

                        NOTE if you upgraded from CTF 6.X, the keystore/trustore has not been migrated by default.  You may need to copy into new java location or repopulate.

                b) Configure Master Password

                        1) If you are going to use the masterpassword log-in module, set the master password by running /opt/collabnet/teamforge/add-ons/ctf_authentication_manager/scripts/mpasswd.sh . Password will be masked while entering.

		c) Configuring site admin account for LDAP Sync

			1) If you want to enable LDAP Sync and if password of 'admin' user account is 'admin', ignore the following steps. Go to Step 9) Create Linked App below. Else perform the following steps.

			Note: It is always advisable not to use 'admin' account credentials. 

			2) If /opt/collabnet/teamforge/add-ons/ctf_authentication_manager/scm.admin file is present (which is by default), LDAP Sync will use 'scmadmin' credentials from runtime options for CTF session.

			3) If /opt/collabnet/teamforge/add-ons/ctf_authentication_manager/scm.admin file is absent/removed, do the following steps for creating CTF session for LDAP Sync to work.

				A) Create a file /opt/collabnet/teamforge/var/etc/soap-provider.properties and copy the following content in that file and save.

					ctf.soap.provider.url = http://localhost:8080
					ctf.soap.provider.username = admin
					ctf.soap.provider.password = {OBF}:urDQ9NtmFqV0tvnnYlGfog==

					obfuscator.prefix = {OBF}:
					obfuscator.key = XSJt43wN

				B) To give proper value to obfuscator.prefix in /opt/collabnet/teamforge/var/etc/soap-provider.properties, run the following command in the command prompt

					[root@cu305 prasanna]# grep OBFUSCATION_PREFIX /opt/collabnet/teamforge/runtime/conf/runtime-options.conf | awk 'BEGIN {FS="="} {print $2}'

				   Give the output value of the above command to obfuscator.prefix in soap-provider.properties

				C) To give proper value to obfuscator.key in /opt/collabnet/teamforge/var/etc/soap-provider.properties, run the following command in the command prompt

					[root@cu305 prasanna]# grep OBFUSCATION_KEY /opt/collabnet/teamforge/runtime/conf/runtime-options.conf | awk 'BEGIN {FS="="} {print $2}'

				   Give the output value of the above command to obfuscator.key in soap-provider.properties

				D) Give some valid site admin username to ctf.soap.provider.username in soap-provider.properties
	
				E) Give 'http://localhost:8080' as value to  ctf.soap.provider.url in soap-provider.properties

				F) To give obfuscated password to ctf.soap.provider.password in /opt/collabnet/teamforge/var/etc/soap-provider.properties, run the following command in the command prompt

					[root@cu305 prasanna]# /opt/collabnet/teamforge/runtime/scripts/obfuscate_util.sh -encrypt '<Your Password>'

					Example: [root@cu305 prasanna]# /opt/collabnet/teamforge/runtime/scripts/obfuscate_util.sh -encrypt 'Collabnet1!'

				   Give the output value of the above command to ctf.soap.provider.password in soap-provider.properties

	9) Linked App

		Now the linked app will be created automatically. If the linked app is not present, create it using the following steps manually.

		a) Log into CTF and go to 'look' project.
		b) Go to Project Admin tab.
		c) Click Tools.
		d) Click 'Add Tool'. 
		e) Select Tool Type as 'Other'.
		f) Give Display Name as 'Authentication Manager' & Check 'Show in Toolbar'.
		g) Give Application URL as 'http(s)://<host>/authenticationManager' & Enable Single Sign On .
		h) Click Save.
		i) Click 'Authentication Manager' button from Project Button Panel.
		j) You will see the Authentication Manager home page and it will have four links in the left panel,

			1. Manage Existing Profiles
			2. Upgrade Legacy Config 
			3. Create Profile
			4. LDAP Sync

	10) If it is an existing site, make sure you visit(click) 'Manage Existing Profiles' atlease once.


 UNINSTALLATION

        To Uninstall the add-on DO NOT RUN THE DEFAULT INSTALLER, instead:

                1) Navigate to the add-on installation directory:
                           "cd /opt/collabnet/teamforge/add-ons/ctf_authentication_manager"

                2) Run the custom uninstall script:
                        "./uninstall.sh"

                3) In the TeamForge web interface remove the linked application created during installation

		4) If you are upgrading this addon, DO NOT Rebuild the TeamForge runtime while uninstalling of older version. Do Rebuild the TeamForge runtime after installing the newer version of this add-on. Else all the profiles created while using the older version of this addon will be lost.

                5) If you want to uninstall this addon and do not want to upgrade this addon then, 

			a) Important: Remove 'add-ons' service from <APP_BOX>:SERVICES token in site-options.conf.

			b) Do TeamForge provision after uninstalling. 

        NOTE: Prior to uninstalling the add-on it is recommended that you use the Authentication Manager GUI to remove all authentication profiles except for the TeamForge Database profile.



 BROWSER COMPATIBILITY

	Functionality should work in CTF supported browsers. Test few cases in each of the browsers mainly in all version of IE.


 TEST CASES


 Site Options Token Test cases
 -----------------------------

  1. Installation of add-on

	Install the Add-on. Add 'add-ons' service to <APP_BOX>:SERVICES token in site-options.conf and do teamforge provision. Check the following

	a. In site-option.conf, following tokens MAY or MAY NOT have the following values,

		USE_EXTERNAL_USER_AUTHENTICATION=true
		LINUX_USERNAME_MODE_ENABLED=true
		MINIMUM_PASSWORD_LENGTH=0
		PASSWORD_REQUIRES_MIXED_CASE=false
		PASSWORD_REQUIRES_NON_ALPHANUM=false
		PASSWORD_REQUIRES_NUMBER=false
		REQUIRE_USER_PASSWORD_CHANGE=false
		REQUIRE_PASSWORD_SECURITY=false
		ALLOW_NO_PASSWORD_ON_USER_CREATION=true

	   But USE_EXTERNAL_USER_AUTHENTICATION will be false for sure. By default it is false when commented.

	b. In runtime-options.conf, following tokens MUST have the following values,

                USE_EXTERNAL_USER_AUTHENTICATION=true
                LINUX_USERNAME_MODE_ENABLED=true
                MINIMUM_PASSWORD_LENGTH=0
                PASSWORD_REQUIRES_MIXED_CASE=false
                PASSWORD_REQUIRES_NON_ALPHANUM=false
                PASSWORD_REQUIRES_NUMBER=false
                REQUIRE_USER_PASSWORD_CHANGE=false
                REQUIRE_PASSWORD_SECURITY=false
                ALLOW_NO_PASSWORD_ON_USER_CREATION=true

	   But USE_EXTERNAL_USER_AUTHENTICATION will be true for sure. 


	c. To confirm more, make sure the 'Create' button is not present in the List User Page.


  2. Provision of CTF after add-on installation - Surviving provision scenario

	Do teamforge provision. Check the following (Assumption the add-on has been already installed)

	a. In site-option.conf, following tokens MAY or MAY NOT have the following values,

                USE_EXTERNAL_USER_AUTHENTICATION=true
                LINUX_USERNAME_MODE_ENABLED=true
                MINIMUM_PASSWORD_LENGTH=0
                PASSWORD_REQUIRES_MIXED_CASE=false
                PASSWORD_REQUIRES_NON_ALPHANUM=false
                PASSWORD_REQUIRES_NUMBER=false
                REQUIRE_USER_PASSWORD_CHANGE=false
                REQUIRE_PASSWORD_SECURITY=false
                ALLOW_NO_PASSWORD_ON_USER_CREATION=true

           But USE_EXTERNAL_USER_AUTHENTICATION will be false for sure. By default it is false when commented.

        b. In runtime-options.conf, following tokens MUST have the following values,

                USE_EXTERNAL_USER_AUTHENTICATION=true
                LINUX_USERNAME_MODE_ENABLED=true
                MINIMUM_PASSWORD_LENGTH=0
                PASSWORD_REQUIRES_MIXED_CASE=false
                PASSWORD_REQUIRES_NON_ALPHANUM=false
                PASSWORD_REQUIRES_NUMBER=false
                REQUIRE_USER_PASSWORD_CHANGE=false                REQUIRE_PASSWORD_SECURITY=false                ALLOW_NO_PASSWORD_ON_USER_CREATION=true

           But USE_EXTERNAL_USER_AUTHENTICATION will be true for sure.


  3. Uninstallation of add-on

	Uninstall the Add-on. Remove 'add-ons' service from <APP_BOX>:SERVICES token in site-options.conf and do teamforge provision. Check the following

        a. Values in both site-option.conf and runtime-options.conf for the following tokens should match,

	   Assumption: No other add-ons/hotfix touches these token

                USE_EXTERNAL_USER_AUTHENTICATION
                LINUX_USERNAME_MODE_ENABLED
                MINIMUM_PASSWORD_LENGTH
                PASSWORD_REQUIRES_MIXED_CASE
                PASSWORD_REQUIRES_NON_ALPHANUM
                PASSWORD_REQUIRES_NUMBER
                REQUIRE_USER_PASSWORD_CHANGE
                REQUIRE_PASSWORD_SECURITY
                ALLOW_NO_PASSWORD_ON_USER_CREATION

  4. Provision of CTF after add-on uninstallation

	a. Values in both site-option.conf and runtime-options.conf for the following tokens should match,

           Assumption: No other add-ons/hotfix touches these token
  
                USE_EXTERNAL_USER_AUTHENTICATION
                LINUX_USERNAME_MODE_ENABLED
                MINIMUM_PASSWORD_LENGTH
                PASSWORD_REQUIRES_MIXED_CASE
                PASSWORD_REQUIRES_NON_ALPHANUM
                PASSWORD_REQUIRES_NUMBER
                REQUIRE_USER_PASSWORD_CHANGE
                REQUIRE_PASSWORD_SECURITY
                ALLOW_NO_PASSWORD_ON_USER_CREATION
 


 To ensure that the external authentication functionality  works, do the following:
 ----------------------------------------------------------------------------------

	NOTE: JBOSS RESTART IS REQUIRED as JBOSS (WildFly) 10.0 don't currently support runtime updates to the login module list within the security domain definition. Please refer https://issues.jboss.org/browse/WFLY-5563

	NOTE: All the values to be given for LDAP/LDAP Extended/Kerberos/AD configuration has to be given by the LDAP/LDAP Extended/Kerberos/AD expert of the respective company. The values that are expected are universal and user should be able to find some help in internet too. 'What kind of value to be provided' is not covered in the README and this is out of the scope of this README.

	Note: Never delete SuperUserAuthenticationBackend Module. This is very important.

        1) Check linked app creation

                STEPS:
                        a) Log-in to the TeamForge web interface as the TeamForge Admin user, "admin"
                        b) Navigate to the look project

                EXPECTED RESULTS:
                        a)  In the project button panel an "Authentication Manager" button should be present

        2) Test application deployment

                STEPS:
                        a) The Authentication Manager web applications should be deployed to JBoss after install, TeamForge restart, and after a rebuild of the TeamForge runtime.  Successful deployment can be confirmed in the "/opt/collabnet/teamforge/log/apps/server.log" file and/or by accessing the deployed application via the UI.
                        b) Confirm the deployment via the UI:
                                a) Follow the steps in TEST CASE #1
                                b) Select the "Authentication Manager" button in the project button panel

                EXPECTED RESULTS:
                        a) The Authentication Manager "Homepage" should be visible in an iframe in the center of the page
                        b) The main menu should be shown on the left hand side with the first entry being "Manage Existing Profiles"

        3) Test profiles can be read

                STEPS:
			a) Follow the steps in TEST CASE #2
                        b) Select the "Manage Existing Profiles" entry from the left-hand menu

                EXPECTED RESULTS:
                        a) The main menu should be shown on the left hand side with the first entry being "Manage Existing Profiles"
                        b) An accordion UI Element should be displayed with a list of existing profiles.
                        c) If this is a new install the "Default TeamForge Database" profile should be shown and the "status indicator" should be green to indicate the profile is active
			Note: It is always advisable to keep the flag as sufficient for all the profile.
                        d) Expand the profile entry(s) and ensure that the contents/fields displayed represent completely and correctly configured profiles


        4) Test profile creation

                STEPS:
                        a) Complete TEST CASES #1-#3
                        b) Follow USAGE instructions for PROFILE CREATION:

                                1) Test LDAP Extended
                                2) Test Master Password
				3) Test LDAP
				4) Test AD
				5) Test Kerberos
				6) Test Teamforge Database

                EXPECTED RESULTS
                        a) Profiles should be successfully created
                        b) After creation the newly created profiles should be shown on the "Manage Existing Profiles" screen
                        c) The newly created profiles should have a yellow "status indicator" to indicate that are inactive (unless in completing the USAGE steps the profiles were activated)


        5) Test profile management

                STEP:
                        a) Complete TEST CASES #4
                        b) There should now be at least 2 profiles visible. The "Default TeamForge Database" (Imported) profile and the newly created profiles.
                        c) Perform the following:

				NOTE : Any profile activation/de-activation needs JBOSS RESTART.

                                1) Attempt to delete an active profile - This should not be allowed
                                2) Deactivate the only active profile - This should not be allowed
                                3) Activate an inactive profile - The "status indicator" should turn green.  The "Activate" button should change to "Deactivate."  If a user authenticates, all active profiles should be used to validate credentials.
                                4) Deactivate an active profile - The "status indicator" should turn yellow. The "Deactivate" button should change to "Activate." If a user authenticates, all deactivated profile should not be used to validate credentials
                                5) Delete an inactive profile -  The profile should disappear. 
                                6) Delete the only active profile - This should not be allowed
				7) 'Deactivate All' profiles - This should deactivate all the profiles except SuperUserAuthenticationBackend module.
				8) 'Activate All' profiles - This should activate all the profiles.
				9) 'Enable Reorder' profiles - The 'Enable Reorder' button should be changed to 'Save Order'. Then user can reorder the profile by pulling up and down and save them using 'Save Order' button.
			       10) Validation Functionalitiy has been cover separately below.

			       11) During Edit Profile - Try to Activate/Validate/Delete/Copy a profile.

			       12) After Editing Proflie with some changes - Click Save button.

			       13) After Editing Profile with any changes - Click Cancel button.

			       14) After Editing Profile without any changes - Click Cancel button.

			       15) After Creating a Profile - Click Copy button when Profile is yet to be activated.

			       16) After Creating a Profile - Click Copy button once Profile is activated.

			       17) Check Validate button in Kerberos/Database/Master Password profiles.

			       18) Check Validate button in LDAP/AD/Extended LDAP profiles.

			       19) Check Copy button in Database/Master Password profiles.

			       20) Check Copy button in LDAP/AD/Extended LDAP/Kerberos profiles.

                EXPECTED RESULTS:
                        a) The results for each stop should be as outlined above in each step
                        b) All changes should end in what seem to be the logical result
			c) All activated profiles will be present in both /opt/collabnet/teamforge/runtime/jboss/standalone/configuration/standalone-full.xml and in IDS in the database while Deactivated profiles will be present only in IDS in the database.
			d) To check in the IDS, use this sql query " select value from integration_data_value where integration_namespace_id = (select id from integration_data_namespace where name='authManager') and name='profiles'; ".
			e) Check the activated profiles manually in standalone-full.xml
			f) Reordering will have an impact in both IDS and standalone-full.xml
			g) During Edit Profile - Only Save button and Cancel button should be enabled. All other buttons should be in disabled state.
			h) Validation button should be preseny only for AD/LDAP/Extended LDAP profiles. For other profiles, it should not be present.
			i) Copy button should be present only for Kerberos/AD/LDAP/Extended LDAP profiles. For other profiles, it should not be present.
			j) Copying a profile either in Activated/Deactivated state will duplicate the profile in Deactivated state.
			k) Canceling an edited profile with or without changes should not change any values in the profile.
			l) Saving an edited profile should save the modified values in the profile.


	6) Multiple profile of same type

		STEP:

			a) Create two LDAP profiles [For one LDAP profile give one of the module option as empty]

			b) Create two Extended LDAP profiles (one profile should a valid profile so that we can test authentication)

			c) Create one Username Database profiles and Master Password profiles

			d) Create two AD profiles [For one AD profile give one of the module option as empty]

			e) Perform the following:

				NOTE : Any profile activation/de-activation needs JBOSS RESTART.

				1) Activate all profiles one by one - The "status indicator" should turn green.  The "Activate" button should change to "Deactivate."  If a user authenticates, all active profiles should be used to validate credentials.

				2) Deactivate all profiles one by one - The "status indicator" should turn yellow. The "Deactivate" button should change to "Activate." If a user authenticates, all deactivated profile should not be used to validate credentials.

				3) Activate few profiles one by one - The "status indicator" should turn green.  The "Activate" button should change to "Deactivate."  If a user authenticates, all active profiles should be used to validate credentials.

				4) 'Deactivate All' profiles in one shot - This should deactivate all the profiles except SuperUserAuthenticationBackend module.

				5) 'Activate All' profiles in one shot - This should activate all the profiles.

				6) 'Enable Reorder' profiles - The 'Enable Reorder' button should be changed to 'Save Order'. Then user can reorder the profile by pulling up and down and save them using 'Save Order' button.


		 EXPECTED RESULTS:

			a) The results for each stop should be as outlined above in each step

                        b) All changes should end in what seem to be the logical result

                        c) All activated profiles will be present in both /opt/collabnet/teamforge/runtime/jboss/standalone/configuration/standalone-full.xml and in IDS in the database while Deactivated profiles will be present only in IDS in the database.

                        d) To check in the IDS, use this sql query " select value from integration_data_value where integration_namespace_id = (select id from integration_data_namespace where name='authManager') and name='profiles'; ".

                        e) Check the activated profiles manually in standalone-full.xml

                        f) Reordering will have an impact in both IDS and standalone-full.xml



        7) Test runtime rebuild

	8) When providing bind password for Extended LDAP, try giving bind password with '\' (Backslash). While activating the profile should not get duplicated and  there should be only one profile and it should get activated. Check both standalone-full.xml and IDS.

	9) Try reloading the application using reloadNow.sh under /opt/collabnet/teamforge/add-ons/ctf_authentication_manager/ instead of complete restart of JBoss.



 Validation functionality:
 -------------------------

	1. A 'Validate' button should be present for AD/LDAP/Extended LDAP profiles.

	2. The 'Validate' button in AD/LDAP/Extended LDAP profiles should be in enabled state when the profile is not edited.

	3. The 'Validate' button in AD/LDAP/Extended LDAP profiles should be in disabled state when the profile is edited.

	4. A 'Validate' button should not be present for other profiles like Database/Master password/Kerberos at any point of time.

	5. Log Level should be controlled by the following command. This is very important case as in FINE level we will be printing password for debugging purpose.

		To enable FINE - /opt/collabnet/teamforge/runtime/jboss/bin/jboss-cli.sh -c --command='/subsystem=logging/logger=etc.LdapValidator:add(level=FINE,handlers=["FILE"])'

			More logs should be printed in server.log

		To disable FINE - /opt/collabnet/teamforge/runtime/jboss/bin/jboss-cli.sh -c --command='/subsystem=logging/logger=etc.LdapValidator:remove()'

			Only 'result' should be printed in server.log


	6. LDAP Success Scenario

		a. Create a valid working LDAP profile.

		b. Click 'Validation' button. It should prompt for sample valid username and password.

		c. Give a valid sample user (it should be name or cn or part of distinguishedName [all the three will be same] not displayName/givenName/sAMAccountName) and password.

		d. Click OK.

		e. A message 'Authentication Successful. Search/Sync not supported in normal Ldap.' in green should be displayed.

		f. Check server.log in FINE level.


	7. LDAP Failure Scenario

		A. Try validating for the following failure scenarios and also check the server.log (important). All the errors should be in red.


		SNO	Wrong Attribute			Expected Error Message


		1. 	provider url			Validation Failed due to Wrong Hostname/Port or LDAP server not running in the mentioned host.	

		2. 	security.authentication		javax.naming.AuthenticationNotSupportedException: <the give invalid auth type>

		3. 	factory.initial			javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory com.sun.jndi.ldassp.LdapCtxFactory..... 

		4. 	principalDNPrefix		Validation Failed due to wrong Username/Password.

		5. 	principalDNSuffix		Validation Failed due to wrong Username/Password.

		6. 	ldaps cert missing		Validation Failed due to non existence of LDAP/AD certificate. Please add LDAP/AD certificate to java key store.


		B. Set allowEmptyPasswords as false and do not give a password while validating. A error message in red 'Password cannot be null as allowEmptyPasswords is false.' should be thrown.

		C. Set allowEmptyPasswords as true and do not give a password while validating. A success message in green 'Authentication Successful. Search/Sync not supported in normal Ldap.' should be thrown.
		   Note: While setting allowEmptyPasswords as true, any username anywhere in the LDAP tree sturcture will be get authenticated.


	8. AD Success Scenario

		a. Create a valid working AD profile.

		b. Click 'Validation' button. It should prompt for sample valid username and password.

		c. Give a valid sample user (it should be name or cn or part of distinguishedName [all the three will be same] not displayName/givenName/sAMAccountName) and password.

                d. Click OK.

		e. A message 'Authentication Successful. Search Successful.' in green should be displayed.

		f. Check server.log in FINE level.

		Note: roleCtxDN should not be same as some userDN


	9. AD Failure Scenario

		A. Try validating for the following failure scenarios and also check the server.log (important). All the errors should be in red.


                SNO     Wrong Attribute                 Expected Error Message


                1.      provider url                    Validation Failed due to Wrong Hostname/Port or LDAP server not running in the mentioned host.

                2.      principalDNPrefix               Validation Failed due to wrong Username/Password.

                3.      principalDNSuffix               Validation Failed due to wrong Username/Password.

		4.      rolesCtxDN wrong 'cn'           Authentication Successful(in green). Exception Occured: Validation Failed due to Invalid BaseCtxDN/RoleCtxDN (in red)

		5.      rolesCtxDN wrong 'dc'            javax.naming.PartialResultException: [LDAP: error code 10 - 0000202B: RefErr: DSID-031006E0]

		6. 	ldaps cert missing              Validation Failed due to non existence of LDAP/AD certificate. Please add LDAP/AD certificate to java key store.



                B. Set allowEmptyPasswords as false and do not give a password while validating. A error message in red 'Password cannot be null as allowEmptyPasswords is false.' should be thrown.

		C. Set allowEmptyPasswords as true and do not give a password while validating. A success message in green 'Authentication Successful. Exception Occured: javax.naming.NamingException: [LDAP: error code 1 - 00000000: LdapErr: DSID-0C090627, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, vece]; remaining name 'cn=Users,dc=qalab,dc=corp,dc=collab,dc=net' ' should be thrown.

		   Note: While setting allowEmptyPasswords as true, any username anywhere in the LDAP tree sturcture will be get authenticated.



		Basic Understanding of search in AD before proceeding for next test case
		-------------------------------------------------------------------------

		a) username - User will enter (valid sample user) this via UI for validation. It should be name or cn or part of distinguishedName [all the three will be same] not displayName/givenName/sAMAccountName

		b) userDN - principalDNPrefix + username + principalDNSuffix

		c) uidAttributeID - We will search for this attribute during search operation. Eg. if uidAttributeID is 'cn", we will search for 'cn'. Basically search attribute.

		d) matchOnUserDN - If true, search value will be userDN. If false, search value will be username. We will search for the 'uidAttributeID' either using userDN or with username based on this value. Logically for name and cn, we need to keep matchOnUserDN as false. For distinguishedName, we need to keep matchOnUserDN as true.

		e) roles are nothing but just another ldap folder.

		f) roleAttributeID - The name of the attribute that contains the user roles (group). Search Result will contain this data i.e. will return the value of this attribute.

                g) rolesCtxDN - This is just another folder search similiar to baseCtxDN. If roleCtxDN and baseCtxDN are different, then the user should be present in both (rolesCtxDN and baseCtxDN) folder structure.

		h) roleAttributeIsDN - Indicates whether the roleAttributeID contains the fully distinguished name of a role object, or the role name. If false, the role name is taken from the value of roleAttributeID. If true, the role attribute represents the distinguished name of a role object. The role name is taken from the value of the roleNameAttributeId attribute of the context name by the distinguished name. 

		i) roleNameAttributeID - The name of the attribute of the context pointed to by the roleCtxDN distinguished name value which contains the role name. If the roleAttributeIsDN property is set to true, this property is used to find the role object's name attribute. 


		Note: There is nothing like wrong value for uidAttributeID, matchOnUserDN, roleAttributeID, roleAttributeIsDN, roleNameAttributeID. Only thing is when given some meaningless value, search won't yield any result.


		D. Set 
			uidAttributeID as 'cn'. 'cn' is just a name. 
			matchOnUserDN as false. 
			roleCtxDN as part of atlease one role
			roleAttributeID as 'memberOf'.
			roleAttributeIsDN as true.
			roleNameAttributeID as 'name'.
			Do validation. 
			All relevant roles will be retrieved with following logs 'memberOf for the searched criteria: <role name>' in server.log.

		E. Set 
                        uidAttributeID as 'cn'. 'cn' is just a name. 
                        matchOnUserDN as true. 
			roleCtxDN as part of atlease one role
                        roleAttributeID as 'memberOf'.
                        roleAttributeIsDN as true.
                        roleNameAttributeID as 'name'.
                        Do validation. 
			Following logs message 'There is no match for the searched criteria.' should be seen in server.log.

		F. Set 
                        uidAttributeID as 'distinguishedName'. 'distinguishedName' is a DN. 
                        matchOnUserDN as false.
			roleCtxDN as part of atlease one role
                        roleAttributeID as 'memberOf'.
                        roleAttributeIsDN as true.
                        roleNameAttributeID as 'name'.
                        Do validation. 
			Following logs message 'There is no match for the searched criteria.' should be seen in server.log.
                
                G. Set
                        uidAttributeID as 'distinguishedName'. 'distinguishedName' is a DN.
                        matchOnUserDN as true. 
			roleCtxDN as part of atlease one role
                        roleAttributeID as 'memberOf'.
                        roleAttributeIsDN as true.
                        roleNameAttributeID as 'name'.
                        Do validation.                        
			All relevant roles will be retrieved with following logs 'memberOf for the searched criteria: <role name>' in server.log.

		H. Set 
			uidAttributeID as 'cn'. 'cn' is just a name. 
                        matchOnUserDN as false.
                        roleCtxDN as part of atlease one role
                        roleAttributeID as 'someThing'.
                        roleAttributeIsDN as true.
                        roleNameAttributeID as 'name'.
                        Do validation.
			Following logs message 'There is no match for the searched criteria.' should be seen in server.log.

		I. Set
			uidAttributeID as 'distinguishedName'. 'distinguishedName' is a DN.
                        matchOnUserDN as true.
                        roleCtxDN as part of atlease one role but not present in another role
                        roleAttributeID as 'memberOf'.
                        roleAttributeIsDN as true.
                        roleNameAttributeID as 'name'.
                        Do validation.                        
                        All relevant roles will be retrieved with following logs 'memberOf for the searched criteria: <role name with given roleCtxDN>' in server.log.

		J. Set
			uidAttributeID as 'distinguishedName'. 'distinguishedName' is a DN.
                        matchOnUserDN as true.
			roleCtxDN not part of any of the roles.
			roleAttributeID as 'memberOf'.
                        roleAttributeIsDN as true.
                        roleNameAttributeID as 'name'.
                        Do validation.
			Following logs message 'There is no match for the searched criteria.' should be seen in server.log.

		K. Set
			uidAttributeID as 'distinguishedName'. 'distinguishedName' is a DN.
                        matchOnUserDN as true.
                        roleCtxDN as part of atlease one role
                        roleAttributeID as 'memberOf'.
                        roleAttributeIsDN as false.
                        roleNameAttributeID as 'name'.
                        Do validation.
                        All relevant roles will be retrieved with following logs 'memberOf for the searched criteria: <role DN>' in server.log.

		L. Set
			uidAttributeID as 'distinguishedName'. 'distinguishedName' is a DN.
                        matchOnUserDN as true.
                        roleCtxDN as part of atlease one role but not present in another role
                        roleAttributeID as 'memberOf'.
                        roleAttributeIsDN as true.
                        roleNameAttributeID as 'uSNCreated'.
                        Do validation.
			All relevant roles will be retrieved with following logs 'memberOf for the searched criteria: <role uSNCreated with given roleCtxDN>' in server.log.

		M. Set
			uidAttributeID as 'distinguishedName'. 'distinguishedName' is a DN.
                        matchOnUserDN as true.
                        roleCtxDN as part of atlease one role but not present in another role
                        roleAttributeID as 'memberOf'.
                        roleAttributeIsDN as false.
                        roleNameAttributeID as 'uSNCreated'.
                        Do validation.
			All relevant roles will be retrieved with following logs 'memberOf for the searched criteria: <role DN>' in server.log.
			
			

       10. Extended LDAP Success Scenario

		a. Create a valid working extended LDAP profile.

		b. Click 'Validation' button. It should prompt for sample valid search username alone.

		c. Give a valid sample search user.

		d. Click OK.

		e. A message 'Authentication Successful. Search Successful.' in green should be displayed.

                f. Check server.log in FINE level.

		Note: roleCtxDN and baseCtxDN should not be same as some userDN


       11. Extended LDAP Failure Scenario

		A. Try validating for the following failure scenarios and also check the server.log (important). All the errors should be in red.


                SNO     Wrong Attribute                 Expected Error Message


                1.      provider url                    Validation Failed due to Wrong Hostname/Port or LDAP server not running in the mentioned host.

		2.      url with wrong protocol         Authentication Successful. javax.naming.NamingException: Cannot parse url: ldapss://1sa0.2.10.10:389/ [Not an LDAP URL: ldapss://1sa0.2.10.10:389/]

		3.      baseCtxDN wrong 'dc'            Authentication Successful. javax.naming.PartialResultException: [LDAP: error code 10 - 0000202B: RefErr: DSID-031006E0]

                4.      baseCtxDN wrong 'cn'            Authentication Successful(in green). Exception Occured: Validation Failed due to Invalid BaseCtxDN/RoleCtxDN (in red)

		5.      rolesCtxDN wrong 'dc'           Authentication Successful. javax.naming.PartialResultException: [LDAP: error code 10 - 0000202B: RefErr: DSID-031006E0]

                6.      rolesCtxDN wrong 'cn'           Authentication Successful(in green). Exception Occured: Validation Failed due to Invalid BaseCtxDN/RoleCtxDN (in red)

                7.      bindDN				Validation Failed due to wrong Username/Password.

		8. 	bindCredential			Validation Failed due to wrong Username/Password.

		9. 	security.authentication		javax.naming.AuthenticationNotSupportedException: simpless

		10. 	factory.initial                 javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory com.sun.jndi.ldassp.LdapCtxFactory.....

		11. 	baseFilter			Authentication Successful. Exception Occured: Validation Failed due to Invalid Base Filter or searched user is not present in the AD/LDAP server (no match found) or Exception Occured: Validation Failed due to Invalid Search Filter Criteria..

		12. 	ldaps cert missing              Validation Failed due to non existence of LDAP/AD certificate. Please add LDAP/AD certificate to java key store.


		Basic Understanding of search in Extended LDAP before proceeding for next test case
                ------------------------------------------------------------------------------------

                a) username - This comes from UI. This is used only for only searching.

		b) bindDN - This is the userid using which we will log into LDAP.

		c) bindCredential - This is the password of above userid.

		d) baseCtxDn - Only those users with this baseCtxDN will be eligible for searching. 

		e) baseFilter - Consider this a substring comparison or regex. We will allow the users for searching only if they have this filter information in them. Eg. (uid={0}) , (sAMAccountName={0}) i.e. say for example if the baseFilter is (sAMAccountName={0}) , then users with (sAMAccountName=<username>) will be considered for searching

                f) rolesCtxDN - This is just another folder search similiar to baseCtxDN. If roleCtxDN and baseCtxDN are different, then the user should be present in both (rolesCtxDN and baseCtxDN) folder structure.

		g) roleFilter - Consider this a substring comparison or regex. We will consider only those roles only if they have this filter information in them. The input username/userDN as obtained from the login module callback will be substituted into the filter anywhere a "{0}" expression is seen. The authenticated userDN will be substituted into the filter anywhere a "{1}" is seen.  An example search filter that matches on the input username is: "(member={0})". An alternative that matches on the authenticated userDN is: "(member={1})". The value given here will be compared with one of the attributes of the user under rolesCtxDN folder sructure.

                h) roles are nothing but another LDAP folder.

                i) roleAttributeID - The name of the attribute that contains the user roles (group). Search Result will contain this data i.e. will return the value of this attribute.

                j) roleAttributeIsDN - Indicates whether the roleAttributeID contains the fully distinguished name of a role object, or the role name. If false, the role name is taken from the value of roleAttributeID. If true, the role attribute represents the distinguished name of a role object. The role name is taken from the value of the roleNameAttributeId attribute of the context name by the distinguished name.

		k) roleRecursion - How deep the role search will go below a given matching context. 

		l) searchTimeLimit - The timeout in milliseconds for the user/role searches. 

		m) searchScope - Sets the search scope to one of the strings. The default is SUBTREE_SCOPE.
			OBJECT_SCOPE : only search the named roles context.
			ONELEVEL_SCOPE : search directly under the named roles context.
			SUBTREE_SCOPE :  If the roles context is not a DirContext, search only the object. If the roles context is a DirContext, search the subtree rooted at the named object, including the named object itself


                Note: There is nothing like wrong value for roleFilter, roleAttributeID, roleAttributeIsDN. Only thing is when given some meaningless value, search won't yield any result. Also no need to test for roleRecursion, searchTimeLimit and searchScope



		B. Modify baseCtxDn to some new value and test

		C. Modify rolesCtxDN to some new value and test

		D. Modify baseFilter to some new value and test

		E. Modify roleFilter to some new value and test



 To ensure that the 'LDAP/AD Sync Functionality' works, do the following:
 ------------------------------------------------------------------------


	NOTE: Currently LDAP/AD Sync Functionality is supported only for 'LDAP Extended' profile.

	1) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync

        2) Complete the form, providing values for all of the settings as appropriate for your needs
        	- See the tooltips of each field for more details
                - To use the mail reporting feature, create a Tracker or Discussion forum, and input the appropriate address in the 'Mail To' field

        3) Click 'Save'

        4) Set Enable Sync to 'true'. Set Enable Group Sync and Enable User Data Sync to 'true'. The corresponding job will run at the interval specified by the '* Job Cron Interval' values.

        5) After the job has run check the following to ensure the synchronization completed properly:

		1) Optionally review '/opt/collabnet/teamforge/log/app/server.log' for indication of synchronization activity
                2) Review Admin -> User Groups to see if new groups were created
                3) Review Admin -> Users, to see if user status was changed
                4) Review Admin -> Users -> {Username} -> Edit, to see if user settings were updated
                5) Review the Discussion Forum or Tracker specified in the "Mail and Reporting Settings" fields, for detailed reports on synchronization activity
		6) organization, City, State and Country of the user, if present in LDAP, should be saved in IDS. This can be verified using this sql query "select * from integration_data_value where name in ('organization','city','state','country') and object_id='<userid>';". 

    2) Test Sync Enable and Save

      	STEPS
        	a) Complete initial set-up
	        b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
			1) Set "Enable Sync" to true
                	2) Set "Enable Group Sync" to true
	                3) Set "Group Job Cron Interval" to '0 0/5 * * * ?' or other short interval
        	        4) Configure other settings as appropriate
                	5) Click Save
	                6) Wait the interval period

        EXPECTED RESULTS
	        a) "server.log" log file displays information including output similar to:
        	        2014-05-08 01:34:51,234 INFO  [net.collab.ldapsync.jobs.LdapSyncLauncher] (http--127.0.0.1-8080-6) scheduled job [ JobDetail 'DEFAULT.group':
                	2014-05-08 01:34:51,241 INFO  [net.collab.ldapsync.jobs.LdapSyncLauncher] (http--127.0.0.1-8080-6) scheduled job [ JobDetail 'DEFAULT.user':
	        b) If email is properly configured new discussion post/new tracker artifact should be saved
        	c) If other settings are configured properly groups and users should sync

    3) Test Disabling and Save

      	STEPS
        	a) Complete initial set-up
        	b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
			1) Set "Enable Sync" to false
	                2) Configure other settings as appropriate
        	        3) Click Save

      	EXPECTED RESULTS
		a) "server.log" log file displays information including output similar to:
        		2014-05-08 01:34:51,234 INFO  [net.collab.ldapsync.jobs.LdapSyncLauncher] (http--127.0.0.1-8080-6) Shutdown complete
	                2014-05-08 01:34:51,241 INFO  [net.collab.ldapsync.jobs.LdapSyncLauncher] (http--127.0.0.1-8080-6) Shutdown complete
		b) If email is properly configured, after interval period no discussion post/no tracker artifact are created
	        c) If other settings are configured properly, after interval period no groups and users sync


   4) User Status Sync - using 'Disable by User Presence' Action

	(A) Flag and Disable user

	a) Complete initial set-up. Set Enable Sync and Enable User Data Sync to 'true'.
	b) Make sure you have atleast few (say 3) existing active users.
	c) Disable one of the active users from LDAP/AD
	d) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
		1) Set 'Enable 'Disable by User Presence' Action ' and 'Enable User Delete Action' to true
		2) Set ' 'Disable by User Presence' Interval (Days)' and 'User Delete Interval (Days)' to zero
		3) Configure other settings as appropriate
		4) Click Save
		5) Click Stop and Click Start
		6) Click 'Run Once'

		EXPECTED RESULTS: User should be flagged. This can be checked in IDS in database using this sql query "select value from integration_data_value where name='flagged' and object_id='<user's id>';"

		7) Again click 'Run Once'

		EXPECTED RESULTS: User should be disabled


	(B) Flag, Disable and Re-enable the user

	a) Complete initial set-up. Set Enable Sync and Enable User Data Sync to 'true'.
        b) Make sure you have atleast few (say 3) existing active users.
        c) Disable one of the active users from LDAP/AD
        d) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                1) Set 'Enable 'Disable by User Presence' Action ', 'Enable User Delete Action' and 'Allow User Re-enabling' to true
                2) Set ' 'Disable by User Presence' Interval (Days)' and 'User Delete Interval (Days)' to zero
                3) Configure other settings as appropriate
                4) Click Save
                5) Click Stop and Click Start
                6) Click 'Run Once'

                EXPECTED RESULTS: User should be flagged. This can be checked in IDS in database using this sql query "select value from integration_data_value where name='flagged' and object_id='<user's id>';"

                7) Again click 'Run Once'

                EXPECTED RESULTS: User should be disabled

		8) Enable the user in LDAP/AD
		9) Click 'Run Once'

		EXPECTED RESULTS: User should be Re-enabled in CTF also and user should become an active user

	       	10) Disable one of the active users from LDAP/AD
		11) Click 'Run Once'

		EXPECTED RESULTS: User should be disabled

		12) Set 'Allow User Re-enabling' to false
		13) Enable the user in LDAP/AD
		14) Click 'Run Once'

                EXPECTED RESULTS: User should NOT be Re-enabled in CTF and user should not become an active user


	(C) Flag, Disable and Delete user

	a) Complete initial set-up. Set Enable Sync and Enable User Data Sync to 'true'.
        b) Make sure you have atleast few (say 3) existing active users.
        c) Delete one of the active users from LDAP/AD
        d) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                1) Set 'Enable 'Disable by User Presence' Action ' and 'Enable User Delete Action' to true
                2) Set ' 'Disable by User Presence' Interval (Days)' and 'User Delete Interval (Days)' to zero
                3) Configure other settings as appropriate. Also make sure 'Reuse username after deletion' is set to true.
                4) Click Save
                5) Click Stop and Click Start
                6) Click 'Run Once'

                EXPECTED RESULTS: User should be flagged. This can be checked in IDS in database using this sql query "select value from integration_data_value where name='flagged' and object_id='<user's id>';"

                7) Again click 'Run Once'

                EXPECTED RESULTS: User should be disabled

		8) Again click 'Run Once'

		EXPECTED RESULTS: User should be deleted and the username should be renamed as <username>_histXX where XX is a numeric like david_hist01. 

		9) Again create the same user (say in our case 'david') in LDAP/AD
		10) Again register that user 'david' as new user with CTF. (Generally it may take a day or two to re-register a user with the same name after deletion)
		11) Delete that user 'david' from LDAP/AD 
		12) Again click 'Run Once' thrice
	
		EXPECTED RESULTS: User should be deleted and the username should be renamed as david_hist02.

		13) Register a new user say 'steven' with CTF.
		14) Delete that user 'steven' from LDAP/AD
		15) Set 'Reuse username after deletion' is set to false. Click Save, Click Stop and Click Start.
		16) Again click 'Run Once' thrice

		EXPECTED RESULTS: User should be deleted and the username should NOT be renamed as steven_hist01. So in otherwords, the user 'steven' cannot be reused at all.


   5) User Status Sync - using 'Disable by Last Login' Action

        (A) Disable user

        a) Complete initial set-up. Set Enable Sync and Enable User Data Sync to 'true'.
        b) Make sure you have atleast few (say 3) existing active users and one of user's last login should be before one day.
        c) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                1) Set 'Enable 'Disable by Last Login' Action ' and 'Enable User Delete Action' to true
                2) Set ' 'Disable by Last Login' Interval (Days)' and 'User Delete Interval (Days)' to zero
                3) Configure other settings as appropriate
                4) Click Save
                5) Click Stop and Click Start
                6) Click 'Run Once'

                EXPECTED RESULTS: User should be disabled


	(B) Disable and Re-enable user

	a) Complete initial set-up. Set Enable Sync and Enable User Data Sync to 'true'.
        b) Make sure you have atleast few (say 3) existing active users and one of user's last login should be before one day.
        c) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                1) Set 'Enable 'Disable by Last Login' Action' and 'Enable User Delete Action' to true
                2) Set ' 'Disable by Last Login' Interval (Days)' and 'User Delete Interval (Days)' to zero
                3) Configure other settings as appropriate
                4) Click Save
                5) Click Stop and Click Start
                6) Click 'Run Once'

                EXPECTED RESULTS: User should be disabled

		7) Set 'Enable 'Disable by Last Login' Action' to false
		8) Click Save
                9) Click Stop and Click Start
                10) Click 'Run Once'

		EXPECTED RESULTS: User should be Re-enabled in CTF also and user should become an active user


	(C) Disable and Delete user

	a) Complete initial set-up. Set Enable Sync and Enable User Data Sync to 'true'.
        b) Make sure you have atleast few (say 3) existing active users and one of user's last login should be before one day.
        c) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                1) Set 'Enable 'Disable by Last Login' Action' and 'Enable User Delete Action' to true
                2) Set ' 'Disable by Last Login' Interval (Days)' and 'User Delete Interval (Days)' to zero
                3) Configure other settings as appropriate. Also make sure 'Reuse username after deletion' is set to true.
                4) Click Save
                5) Click Stop and Click Start
                6) Click 'Run Once'

                EXPECTED RESULTS: User should be disabled

                7) Again click 'Run Once'

                EXPECTED RESULTS: User should be deleted and the username should be renamed as <username>_histXX where XX is a numeric like david_hist0
		8) Set 'Reuse username after deletion' is set to false. Click Save, Click Stop and Click Start.
		9) Make sure one more user say 'steven' whose last login is before one day 
                10) Again click 'Run Once' twice

                EXPECTED RESULTS: User should be deleted and the username should NOT be renamed as steven_hist01. So in otherwords, the user 'steven' cannot be reused at all.


   6) User Status Sync - With ' 'Disable by User Presence' Interval (Days)' , ' 'Disable by Last Login' Interval (Days)' and 'User Delete Interval (Days)' as non zero values

	a) Complete initial set-up. Set Enable Sync and Enable User Data Sync to 'true'.
        b) Make sure you have atleast few (say 3) existing active users and two of user's (userA and userB) last login should be before five day.
        c) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                1) Set 'Enable 'Disable by Last Login' Action' , 'Enable User Delete Action' and 'Allow User Re-enabling' to true
                2) Set ' 'Disable by Last Login' Interval (Days)' and 'User Delete Interval (Days)' to five days
                3) Configure other settings as appropriate. Also make sure 'Reuse username after deletion' is set to true.
                4) Click Save
                5) Click Stop and Click Start
                6) Click 'Run Once'

                EXPECTED RESULTS: userA and userB should be disabled

		7) Move the system date to 6 days ahead.
		8) Set 'Enable 'Disable by Last Login' Action' to false. Click Save. Click Stop and Click Start. 
		9) Click 'Run Once' again

		EXPECTED RESULTS: Both userA and userB should be re-enabled

		10) Set 'Enable 'Disable by User Presence' Action', 'Enable User Delete Action' to true
                11) Set ' 'Disable by User Presence' Interval (Days)' and 'User Delete Interval (Days)' to five days
		12) Configure other settings as appropriate. Also make sure 'Reuse username after deletion' is set to true.
                13) Click Save
                14) Click Stop and Click Start
		15) Delete userA from LDAP/AD
                15) Click 'Run Once'

		EXPECTED RESULTS: userA should be flagged. This can be checked in IDS in database using this sql query "select value from integration_data_value where name='flagged' and object_id='<user's id>';"

		16) Again click 'Run Once'

                EXPECTED RESULTS: userA should be disabled

                17) Click 'Run Once'

                EXPECTED RESULTS: userA should be deleted and the username should be renamed as <username>_histXX where XX is a numeric like david_hist01

		18) Register a new user say 'steven' with CTF.
                19) Delete that user 'steven' from LDAP/AD
                20) Set 'Reuse username after deletion' is set to false. Click Save, Click Stop and Click Start.
                21) Again click 'Run Once' thrice

                EXPECTED RESULTS: User should be deleted and the username should NOT be renamed as steven_hist01. So in otherwords, the user 'steven' cannot be reused at all.


   7) User Info Sync

	a) Complete initial set-up. Set Enable Sync and Enable User Data Sync to 'true'.
        b) Make sure you have atleast few (say 3) existing active users.
        c) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                1) Set 'Default Email Address' as appropriate
                2) Make sure the username is not present (as such or as wild card pattern) in 'Excluded Usernames' list 
                3) Configure other settings as appropriate
                4) Click Save
                5) Click Stop and Click Start
                6) Click 'Run Once'

                EXPECTED RESULTS: Fullname, Email and organization of the username in LDAP/AD will be synced with CTF username. If the Email is not present, then the 'Default Email Address' set in UI will be used to sync.

		7) Double Byte Character Support
	           -----------------------------

        	   As of now double byte characters (CJK and European characters) are supported for the following while user info sync,

                       	Fullname - Support CJK and European
	                Org - Support CJK and European
        	        Email - EMail in LDAP/CTF doesn't support CJK and European. So we don't support it.

		   Repeat Step 1-6 for Double Byte Characters

		EXPECTED RESULTS: Fullname, Email and organization of the username in LDAP/AD will be synced with CTF username.

		8) Add the username to the 'Excluded Usernames' list in the UI
		9) In LDAP/AD side, modify the fullname of one of the user to a new value and disable another user.
		10) Click Save
                11) Click Stop and Click Start
                12) Click 'Run Once'

		EXPECTED RESULTS: Fullname, Email and organization of the username in LDAP/AD should NOT be synced with CTF username. Also the status should not be synced.

		13) Add the username as wild card pattern (i.e. if the username is david, wild card pattern can be dav*) to the 'Excluded Usernames' list in the UI
                14) Click Save
                15) Click Stop and Click Start
                16) Click 'Run Once'

                EXPECTED RESULTS: Fullname, Email and organization of the username in LDAP/AD should NOT be synced with CTF username. Also the status should not be sync
ed.


   8) Disable User Data Sync

	a) Complete initial set-up. Set Enable Sync to 'true' and Enable User Data Sync to 'false'.
	b) Make sure you have atleast few (say 3) existing active users.
	c) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                1) Configure all settings as appropriate
                2) Click Save
                3) Click Stop and Click Start
                4) Click 'Run Once'

		EXPECTED RESULTS: User Data Sync should NOT be run and no reports should be generated for user data sync. This can be verified in server.log.

  
   9) Group Sync

	a) Complete initial set-up. Set Enable Sync and Enable Group Sync to 'true'.
        b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                1) Set 'Group Search Filter Arguments' to 'Team*,CTF*'
		2) Configure other group settings as appropriate
		3) Set 'Enable User Membership Action' to false in user data sync setting.
                4) Click Save
                5) Click Stop and Click Start
                6) Click 'Run Once'

		EXPECTED RESULTS: All groups in LDAP/AD which starts with Team* or CTF*, will be synced/created as empty UserGroup in CTF side

		7) Set 'Group Search Filter Arguments' to '*'
		8) Click Save
                9) Click Stop and Click Start
                10) Click 'Run Once'

		EXPECTED RESULTS: All groups in LDAP/AD, will be synced/created in CTF side as empty UserGroup in CTF side

		11) Set 'Enable User Membership Action' to true
		12) Click Save
                13) Click Stop and Click Start
                14) Click 'Run Once'

		EXPECTED RESULTS: All groups in LDAP/AD, will be synced/created in CTF side and all the users within that group in LDAP/AD side should be synced/added with the UserGroup of CTF. Only the existing users in CTF will be added to the UserGroup. 

		For example, Say an UsrGrp1 in LDAP/AD has user1, user2 and user3. But only user1 and user2 are existing users in CTF side. When group syncing, a UserGroup UsrGrp1 will be created with user1 and user2 only and user3 won't be present in CTF side as it doesn't exist in CTF.



   10) Disable Group Sync

        a) Complete initial set-up. Set Enable Sync to 'true' and Enable Group to 'false'.
        b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                1) Configure all settings as appropriate
                2) Click Save
                3) Click Stop and Click Start
                4) Click 'Run Once'

                EXPECTED RESULTS: User Group Sync should NOT be run and no reports should be generated for group sync. This can be verified in server.log.



   11) Mailing Functionality

	a) Complete initial set-up. Set Enable Sync to 'true'. Set Enable Group Sync and Enable User Data Sync to 'true'
	b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
		1) Set 'Enable User Email Reports' to true
		2) Set 'Mail To' to a proper email id like david@collab.net

		   Note: For sending mails to proper mail ids like remya@mail-qa1.maa.collab.net, configure the following too

			A. JAMES_RELAY_USER (from runtime options) as 'Mail Username:'. This is now auto populated but should be saved explicitly.
			B. JAMES_RELAY_PASSWORD (from runtime options) as 'Mail Password:'. This can be a plain text or an obfuscated one. This is now auto populated but should be saved explicitly.

		3) Set 'Mail From' to an existing email of a CTF user who is a site admin or who has complete tracker and discussion permissions.
		4) Set 'Mail CC' to a tracker email id and discussion email id as CSV value.
		5) Configure other mail settings as appropriate
                6) Click Save
                7) Click Stop and Click Start
                8) Click 'Run Once'

		EXPECTED RESULTS: 2 Emails - one for user data sync with 2 attachments along with the summary of the run and one for group sync with 1 attachment along with the summary of the run should be sent to proper email id. Two artifacts - one for user data sync with 2 attachments along with the summary of the run as description and one for group sync with 1 attachment along with the summary of the run as description should be created. Two discussion topics - one for user data sync with 2 attachments along with the summary of the run as description and one for group sync with 1 attachment along with the summary of the run as description should be created.

		9) Set Enable Group Sync to 'false' and Enable User Data Sync to 'true'
		10) Click Save
                11) Click Stop and Click Start
                12) Click 'Run Once'

		EXPECTED RESULTS: One Email for user data sync with 2 attachments along with the summary of the run should be sent to proper email id. One artifact for user data sync with 2 attachments along with the summary of the run as description should be created. One discussion topic for user data sync with 2 attachments along with the summary of the run as description should be created. No blank email should be sent for group sync. No artifact or discussion topic should be created for group sync.

		13) Set Enable Group Sync to 'true' and Enable User Data Sync to 'false'
		14) Click Save
                15) Click Stop and Click Start
                16) Click 'Run Once'

		EXPECTED RESULTS: One Email for group sync with 1 attachment along with the summary of the run should be sent to proper email id. One artifact for group sync with 1 attachment along with the summary of the run as description should be created. One discussion topic for group sync with 1 attachment along with the summary of the run as description should be created. No blank email should be sent for user data sync. No artifact or discussion topic should be created for user data sync.

		17) Set Enable Group Sync to 'false' and Enable User Data Sync to 'false'
		18) Click Save
                19) Click Stop and Click Start
                20) Click 'Run Once'

		EXPECTED RESULTS: No blank emails should be sent for user data sync and group sync. No artifacts or discussion topics should be created for user data sync and group sync.

		21) Set Enable Group Sync to 'true' and Enable User Data Sync to 'true'
		22) Set Enable Sync to 'false'
		23) Click Save
                24) Click Stop and Click Start
                25) Click 'Run Once'

		EXPECTED RESULTS: No blank emails should be sent for user data sync and group sync. No artifacts or discussion topics should be created for user data sync and group sync.

		26) Set 'Enable User Email Reports' to false
		27) Set Enable Group Sync to 'true' and Enable User Data Sync to 'true'
		28) Set Enable Sync to 'true'
                29) Click Save
                30) Click Stop and Click Start
                31) Click 'Run Once'

		EXPECTED RESULTS: No blank emails should be sent for user data sync and group sync. No artifacts or discussion topics should be created for user data sync and group sync.


   12) Reporting Functionality

	a) Complete initial set-up. Set Enable Sync to 'true'. Set Enable Group Sync and Enable User Data Sync to 'true'
        b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                1) Set 'Enable User Email Reports' to true
                2) Set 'Mail To' to a proper email id like david@collab.net
                3) Set 'Mail From' to an existing email of a CTF user who is a site admin or who has complete tracker and discussion permissions.
                4) Set 'Mail CC' to a tracker email id and discussion email id as CSV value.
                5) Configure other mail settings as appropriate
                6) Click Save
                7) Click Stop and Click Start
                8) Click 'Run Once'

                EXPECTED RESULTS: 

		a) 2 reports as attachments 'UserDataSync_Report.csv' and 'UserDataSync_ExceptionalReport.csv' should be created for user data sync.

			i) Format of UserDataSync_Report.csv will be

				Username, Action

				like

					david, User Info Updated
					raman, User Flagged
					sarah, User disabled


			ii) Format of UserDataSync_ExceptionalReport.csv will be

				User Name, Email, Multiple Exception, Status, Exception

				like

					david, david@gmail.com, Yes, Deletion Pending, Connection Exception with full Trace and Socket Exception with full Trace


		b) 1 report as attachment 'GroupSync_Report.csv' should be created for group sync.		

			i) Format of GroupSync_Report.csv will be 

				Group Name, Action 

				like 
					UsrGrp1, Group Added		
					UsrGrp2, Group Added		
					UsrGrp3, Group Added		


   13) Split Functionality

	a) Complete initial set-up. Set Enable Sync and Enable User Data Sync to 'true'.
        b) Make sure you have atleast few (say 35) existing active users.
        c) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                1) Set 'Split Users for LDAP Sync' to '3'
                2) Configure other settings as appropriate
                3) Click Save
                4) Click Stop and Click Start
                5) Click 'Run Once'

                EXPECTED RESULTS: In this run, only the FIRST (1/3) * (total number of users) [i.e. user1...user10] will be considered for user data syncing. Check server.log

		6) Click 'Run Once'

		EXPECTED RESULTS: In this run, only the SECOND (1/3) * (total number of users) [i.e. user11...user20] will be considered for user data syncing. Check server.log

		7) Click 'Run Once'

		EXPECTED RESULTS: In this run, LAST (1/3) * (total number of users) + remaining users [user21...user35] will be considered for user data syncing. Check server.log

		8) Set 'Split Users for LDAP Sync' to '0' or '1'
		9) Click 'Run Once'

		EXPECTED RESULTS: In this run, all the users will be considered for syncing. Check server.log


	NOTE: Disable and Delete logic will have some impact. This is considered as a known behaviour.


   14) User Info Sync and Group Sync - Mapping Functionality

        a) Complete initial set-up. Set Enable Sync, Enable Group Sync and Enable User Data Sync to 'true'.
        b) Make sure you have atleast few (say 3) existing active users.
        c) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
		1) Check the Mapping Settings for each 'Extended LDAP' profile in look project -> Authentication Manager -> Manage Profiles.

		EXPECTED RESULTS: There will be 4 fields for both User Data Sync (three for user data sync) and Group Sync (one for group). They are
			User Data Sync
			--------------
			LDAP Sync Full Name Attribute:
			LDAP Sync Email Attribute:
			LDAP Sync Organization Attribute:
			LDAP Sync User memberOf Attribute:

			Group Sync
			----------			
			LDAP Sync GroupName Attribute:

		2) Keep the default values as is. Say if the default values are

			LDAP Sync Full Name Attribute: displayName
                        LDAP Sync Email Attribute: mail
                        LDAP Sync Organization Attribute: company
                        LDAP Sync GroupName Attribute: name
			LDAP Sync User memberOf Attribute: memberOf


                3) Set 'Enable User Membership Action' to false in user data sync setting. Configure other settings as appropriate
                4) Click Save
                5) Click Stop and Click Start
                6) Click 'Run Once'

                EXPECTED RESULTS: displayName, mail and company of the username in LDAP/AD will be synced with CTF username's Fullname, email and organisation respectivily. While creating groups in CTF, the group title should be the Groups's name in AD 

		7) Change the default values. Say for example

                        LDAP Sync Full Name Attribute: company
                        LDAP Sync Email Attribute: displayName
                        LDAP Sync Organization Attribute: mail
                        LDAP Sync GroupName Attribute: distinguishName
			LDAP Sync User memberOf Attribute: <some other relevant value>

		8) Set 'Enable User Membership Action' to false in user data sync setting. Configure other settings as appropriate
                9) Click Save
               10) Click Stop and Click Start
               11) Click 'Run Once'

                EXPECTED RESULTS: company, displayName and mail of the username in LDAP/AD will be synced with CTF username's Fullname, email and organisation respectivily. While creating groups in CTF, the group title should be the Groups's distinguishName in AD

	       12) Keep the default values as is. Say if the default values are

                        LDAP Sync Full Name Attribute: displayName
                        LDAP Sync Email Attribute: mail
                        LDAP Sync Organization Attribute: company
                        LDAP Sync GroupName Attribute: name
                        LDAP Sync User memberOf Attribute: memberOf

	       13) Set 'Enable User Membership Action' to true in user data sync setting. Configure other settings as appropriate
               14) Click Save
               15) Click Stop and Click Start
               16) Click 'Run Once'

                EXPECTED RESULTS: displayName, mail and company of the username in LDAP/AD will be synced with CTF username's Fullname, email and organisation respectivily. While creating groups in CTF, the group title should be the Groups's name in AD. The users whose 'memberOf' is an existing CTF group as well will be added to that group in CTF side also.

	       17) Change the default values. Say for example

                        LDAP Sync Full Name Attribute: company
                        LDAP Sync Email Attribute: displayName
                        LDAP Sync Organization Attribute: mail
                        LDAP Sync GroupName Attribute: distinguishName
                        LDAP Sync User memberOf Attribute: <some other relevant value>

               18) Set 'Enable User Membership Action' to true in user data sync setting. Configure other settings as appropriate
               19) Click Save
               20) Click Stop and Click Start
               21) Click 'Run Once'

		EXPECTED RESULTS: displayName, mail and company of the username in LDAP/AD will be synced with CTF username's Fullname, email and organisation respectivily. While creating groups in CTF, the group title should be the Groups's name in AD. The users whose '<some other relevant value>' is an existing CTF group as well will be added to that group in CTF side also.


   15) User Info/Status Sync and Group Sync - Mapping Functionality with wrong mapping (User Status Sync Alone scenario.)

        a) Complete initial set-up. Set Enable Sync, Enable Group Sync and Enable User Data Sync to 'true'.
        b) Make sure you have atleast few (say 3) existing active users.
        c) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
		1) Check the Mapping Settings for each 'Extended LDAP' profile in look project -> Authentication Manager -> Manage Profiles.

		EXPECTED RESULTS: There will be 4 fields for both User Data Sync (three for user data sync) and Group Sync (one for group). They are
			User Data Sync
			--------------
			LDAP Sync Full Name Attribute:
			LDAP Sync Email Attribute:
			LDAP Sync Organization Attribute:
			LDAP Sync User memberOf Attribute:

			Group Sync
			----------			
			LDAP Sync GroupName Attribute:

		2) Chane the default values of Full Name, Email and Organization to some non-existing value 

			LDAP Sync Full Name Attribute: DO_NOT_MAP
                        LDAP Sync Email Attribute: DO_NOT_MAP
                        LDAP Sync Organization Attribute: DO_NOT_MAP
                        LDAP Sync GroupName Attribute: name
			LDAP Sync User memberOf Attribute: memberOf


                3) Set 'Enable User Membership Action' to false in user data sync setting. Enable all status flags - 'Enable 'Disable by User Presence' Action', 'Enable 'Disable by Last Login' Action' and 'Enable User Delete Action' with appropriate intervals. Configure other settings as appropriate.
                4) Click Save
                5) Click Stop and Click Start
                6) Click 'Run Once'

                EXPECTED RESULTS: User Info sync won't happen and User Status sync will happen. displayName, mail and company of the username in LDAP/AD will NOT be synced with CTF username's Fullname, email and organisation respectivily. But user status sync will happen. While creating groups in CTF, the group title should be the Groups's name in AD 

	        7) Set 'Enable User Membership Action' to true in user data sync setting. Enable all status flags - 'Enable 'Disable by User Presence' Action', 'Enable 'Disable by Last Login' Action' and 'Enable User Delete Action' with appropriate intervals. Configure other settings as appropriate.
                8) Click Save
                9) Click Stop and Click Start
               10) Click 'Run Once'

                EXPECTED RESULTS: User Info sync won't happen and User Status sync will happen. displayName, mail and company of the username in LDAP/AD will NOT be synced with CTF username's Fullname, email and organisation respectivily. But user status sync will happen. While creating groups in CTF, the group title should be the Groups's name in AD. The users whose 'memberOf' is an existing CTF group as well will be added to that group in CTF side also.


   16) User Status Sync - using Enable Grace Interval for 'Disable by Last Login' Action

        (A) 'Enable 'Disable by Last Login' Action ' without Enable Grace Interval for 'Disable by Last Login' Action

        a) Complete initial set-up. Set Enable Sync and Enable User Data Sync to 'true'.
        b) Make sure you have atleast few (say 3) existing active users and one of user's last login should be before one day.
        c) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                1) Set 'Enable 'Disable by Last Login' Action ' and 'Enable User Delete Action' to true
                2) Set ' 'Disable by Last Login' Interval (Days)' and 'User Delete Interval (Days)' to zero. Set Enable Grace Interval for 'Disable by Last Login' Action to false
                3) Configure other settings as appropriate
                4) Click Save
                5) Click Stop and Click Start
                6) Click 'Run Once'

                EXPECTED RESULTS: User should be disabled


	(B) 'Enable 'Disable by Last Login' Action ' with Enable Grace Interval for 'Disable by Last Login' Action - 'Never activated manually' users

        a) Complete initial set-up. Set Enable Sync and Enable User Data Sync to 'true'.
        b) Make sure you have atleast few (say 3) existing active users and one of user's last login should be before one day and who was never activated manually via UI or API.
        c) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                1) Set 'Enable 'Disable by Last Login' Action ' and 'Enable User Delete Action' to true
                2) Set ' 'Disable by Last Login' Interval (Days)' and 'User Delete Interval (Days)' to zero. Set Enable Grace Interval for 'Disable by Last Login' Action to true and set 'Grace Interval for 'Disable by Last Login' (Days)' as 3 days.
                3) Configure other settings as appropriate
                4) Click Save
                5) Click Stop and Click Start
                6) Click 'Run Once'

                EXPECTED RESULTS: User should be disabled.


	(C) 'Enable 'Disable by Last Login' Action ' with Enable Grace Interval for 'Disable by Last Login' Action - 'Activated manually' users

        a) Complete initial set-up. Set Enable Sync and Enable User Data Sync to 'true'.
        b) Make sure you have atleast few (say 3) existing active users and one of user's last login should be before one day and who was not activated manually via UI or API.
        c) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                1) Set 'Enable 'Disable by Last Login' Action ' and 'Enable User Delete Action' to true
                2) Set ' 'Disable by Last Login' Interval (Days)' and 'User Delete Interval (Days)' to zero. Set Enable Grace Interval for 'Disable by Last Login' Action to true and set 'Grace Interval for 'Disable by Last Login' (Days)' as 3 days.
                3) Configure other settings as appropriate
                4) Click Save
                5) Click Stop and Click Start
                6) Click 'Run Once'

                EXPECTED RESULTS: User should be disabled.

		7) Manually activate the user via UI.
		8) Click 'Run Once' within 3 days

		EXPECTED RESULTS: User should NOT be disabled for 3 days

		8) Either set the 'Grace Interval for 'Disable by Last Login' (Days)' as 0 day or wait for 3 days.
		9) Click 'Run Once'

		EXPECTED RESULTS: User should be disabled

		10) Consider another user whose last login should be before one day and who was activated manually via UI or API long back (i.e. before 3 days).
		11) Click 'Run Once'

                EXPECTED RESULTS: User should be disabled

		12) Consider another user whose last login should be before one day and who was activated manually via UI or API in recent past (i.e. within 3 days).
                13) Click 'Run Once'

                EXPECTED RESULTS: User should NOT be disabled


	(D) Enable Grace Interval for 'Disable by Last Login' Action with 'Enable User Delete Action' and Enable 'Disable by User Presence' Action

		This Enable Grace Interval for 'Disable by Last Login' Action flag SHOULD NOT have any impact on 'Enable User Delete Action' flag and Enable 'Disable by User Presence' Action flag.




 To ensure that the 'New User Creation Functionality' works, do the following:
 -----------------------------------------------------------------------------


	NOTE 1: Currently New User Creation Functionality is completely available only for 'LDAP Extended' profile. Only in case of 'LDAP Extended' profile we can fetch user details from LDAP which will be used during New User Creation. For other profile, we won't create user at all. For other profiles, it is better to go for 'SCENARIO 1'

	NOTE 2: Also it is advisable to disable LDAP Sync Completely, if the user is going to key-in the Fullname, Email, Organization, Locale and License Type in new user creation page. Otherwise the details keyed-in while new user creation will be lost and be overwritten by user info from LDAP when the ldap sync runs.


	Double Byte Character Support
        -----------------------------

        As of now double byte characters (CJK and European characters) are supported for the following while new user creation,

                Password - Support CJK and European

                From LDAP (hide.sh scenario):

                        Fullname - Support CJK and European
                        Org - Support CJK and European
                        Email - EMail in LDAP/CTF doesn't support CJK and European. So we don't support it.

                From UI (show.sh scenario):

                        Fullname - Support CJK and European
                        Org - Support CJK and European
                        Email - EMail in CTF doesn't support CJK and European. So we don't support it.


	Test the following scenarios using English Characters, double byte characters and mixed.


	SCENARIO 1: When Fullname, Email, Organization, Locale, Timezone and License Type are visible to the user. It is advisable to disable LDAP Sync Completely for this scenario. This scenario will come into picture when we don't run hide.sh while installation and APPROVE_NEW_USER_ACCOUNTS is false in site options. If you have run hide.sh by mistake while installation and if you want the user to key in the details while user account creation, run show.sh

	1) Create user by getting data from UI with LDAP Sync enabled and LDAP having valid data for that user.

	STEPS
		a) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
			1) Set "Enable Sync" to true and set Enable User Data Sync to 'true'
                        2) Configure other settings as appropriate
                        3) Click Save
		b) Run show.sh
		c) Change the landing page and 'Is Restricted' in /opt/collabnet/teamforge/add-ons/ctf_authentication_manager/etc/adsync.ini file
		d) Log in as new user
		e) Give valid data to Fullname, Email, Organization, Locale, Timezone and License Type in New User Creation UI
		f) LDAP should have valid data (Fullname, Email and organization) for this new user.
		g) Give Password and click 'Create' button in New User Creation UI


	EXPECTED RESULTS
		New user should be created in CTF with data keyed-in through UI. New user should be logged in to CTF without approval and email verification and should be taken directly to the landing page which is configured in the ini file. This user will be created as a restricted user based on 'Is Restricted' which is configured in the ini file.


	2) Create user by getting data from UI with LDAP Sync enabled and LDAP having empty data for that user.

	 STEPS
                a) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true and set Enable User Data Sync to 'true'
                        2) Configure other settings as appropriate
                        3) Click Save
		b) Run show.sh
                c) Log in as new user
                d) Give valid data to Fullname, Email, Organization, Locale, Timezone and License Type in New User Creation UI
                e) LDAP should have empty data (Fullname, Email and organization) for this new user.
		f) Give Password and click 'Create' button in New User Creation UI


        EXPECTED RESULTS
                New user should be created in CTF with data keyed-in through UI.
		

	3) Create user by getting data from UI with LDAP Sync disabled.

	STEPS
                a) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to false or set Enable User Data Sync to 'false'
                        2) Configure other settings as appropriate
                        3) Click Save
		b) Run show.sh
                c) Log in as new user
                d) Give valid data to Fullname, Email, Organization, Locale, Timezone and License Type in New User Creation UI
		e) Give Password and click 'Create' button in New User Creation UI


        EXPECTED RESULTS
                New user should be created in CTF with data keyed-in through UI.


	SCENARIO 2: When Fullname, Email, Locale, Organization, Timezone and License Type are hidden from the user. It is advisable to enable LDAP Sync for this scenario so that we can fetch fullname, email and organsiation from LDAP/AD. This scenario will come into picture when we run hide.sh while installation and APPROVE_NEW_USER_ACCOUNTS is false in site options. 

	1) Create user with LDAP Sync enabled. Here LDAP should have valid data (Fullname, Email and organization) for this user.

	STEPS
                a) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true and set Enable User Data Sync to 'true'
                        2) Configure other settings as appropriate
                        3) Click Save
		b) Run hide.sh
                c) Log in as new user
		d) Give Password and click 'Create' button in New User Creation UI


        EXPECTED RESULTS		
		New user should be created with data from LDAP. Fullname, Email and organization should be from LDAP. Locale, Timezone and License Type will be the one configured in ini file. If Locale, Timezone and License Type are empty in ini files, then their default values Locale('en'), Timezone('MST') and License Type ('ALM') will be used while user creation.
		Important: It should abide the MAPPING RULES.


	2) Create user with LDAP Sync enabled. Here LDAP should have empty data (Fullname, Email and organization) for this user.

	STEPS
                a) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true and set Enable User Data Sync to 'true'
                        2) Configure other settings as appropriate
                        3) Click Save
                b) Run hide.sh
                c) Log in as new user
                d) Give Password and click 'Create' button in New User Creation UI


        EXPECTED RESULTS
 		a) New user should NOT be created without fullname and email.
		b) Once fullname and email is given in LDAP/AD, new user should be created even if organization is empty. Locale, Timezone and License Type will be the one configured in ini file. If Locale, Timezone and License Type are empty in ini files, then their default values Locale('en'), Timezone('MST') and License Type ('ALM') will be used while user creation.


	3) Create user with LDAP Sync Disable.

	STEPS
                a) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to false or set Enable User Data Sync to 'false'
                        2) Configure other settings as appropriate
                        3) Click Save
                b) Run hide.sh
                c) Log in as new user
                d) Give Password and click 'Create' button in New User Creation UI


        EXPECTED RESULTS
                New user should NOT be created without fullname and email.

	4) Create user with LDAP Sync enabled. Here LDAP has empty data (Fullname, Email and organization) for this user.

	STEPS
		a) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true and set Enable User Data Sync to 'true'
			2) Add this user to the exclude user list of User Data Sync section in look project -> Authentication Manager -> LDAP Sync
                        3) Configure other settings as appropriate
                        4) Click Save
		b) Run hide.sh
                c) Log in as new user
                d) Give Password and click 'Create' button in New User Creation UI


	EXPECTED RESULTS
		New user should be created with default data. Fullname will be same as username and organization will be empty. Email (default email), Locale, Timezone and License Type will be the one configured in ini file. If Email, Locale, Timezone and License Type are empty in ini files, then their default values Email('unknown@unknown.example.com'), Locale('en'), Timezone('MST') and License Type ('ALM') will be used while user creation.
		Important: It should abide the MAPPING RULES


	SCENARIO 3: Set APPROVE_NEW_USER_ACCOUNTS as true in site options

	If APPROVE_NEW_USER_ACCOUNTS is true, we will follow the core product behaviour i.e. for any new user, if the credentials are validated successfully against LDAP/AD we will prompt for retype password, fullName, email, locale, timezone, licenseType. User has to undergo site admin approval and email activation.

	STEPS

		a) Log in as new user
		b) Give valid data to Fullname, Email, Locale, Timezone and License Type in New User Creation UI
                c) Give Password and click 'Create' button in New User Creation UI


	EXPECTED RESULTS
		This would follow the core product site admin approval and email verification check. No LDAP data would be considered while creation.



	COMMON FOR ALL SCENARIO:

		Any error while new user creation should be logged in a particular format in ctf_authentication_manager_newuser_registration.log for future reference and parsing

		Format is: Error: Unable to create/register user: <username>, Cause: <some cause>. Please try again.



 To ensure that the 'Selective Sync Functionality' works, do the following:
 --------------------------------------------------------------------------


        NOTE: This will sync only fullname, email and organization. This won't sync Status.


	1. Log in as normal user. Go to Edit User page. 'Sync User Info' button should not be present.

	2. Login as site admin user. Disable LDAP Sync. Go to Edit User page. 'Sync User Info' button should not be present.

	3. Login as site admin user. Enable LDAP Sync but disable LDAP User Data Job. Go to Edit User page. 'Sync User Info' button should not be present.

	4. Login as 'admin' user. Go to edit user page of 'admin' user (/sf/global/do/editUser/admin). 'Sync User Info' button should not be present i.e. 'admin' user cannot sync themselves but 'admin' account can sync other users.

	5. Login as site admin user. Go to edit user page of deleted '<>_histXX' users / disabled users. 'Sync User Info' button should not be present.

	6. Login as site admin user. Go to edit user page of Active users. 'Sync User Info' button should be present.

	7. Login as site admin user. Go to edit user page of Active users. 'Sync User Info' button should be present. Click 'Sync User Info' button. This should sync user details such as fullname, email and organization from AD/LDAP to CTF of that user.

	Important: It should abide the MAPPING RULES.

	8. Double Byte Character Support
           -----------------------------

        	As of now double byte characters (CJK and European characters) are supported for the following while selective sync,

                        Fullname - Support CJK and European
                        Org - Support CJK and European
                        Email - EMail in LDAP/CTF doesn't support CJK and European. So we don't support it.

        	Test the above scenario using English Characters, double byte characters and mixed.

	9. Do a normal ldap sync and direct UI update of that user after the above case.



 To ensure that the 'Auto User Creation Sync Functionality' works, do the following:
 -------------------------------------------------------------------------------------

	1) Make sure ALLOW_NO_PASSWORD_ON_USER_CREATION site option token is set to True in runtime option.

        2) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync

        3) Complete the form, providing values for all of the settings as appropriate for your needs
                - See the tooltips of each field for more details

	4) Important: By default this Auto User Creation Sync Functionality' should be disabled on new installation.

	5) NOTE: Currently Auto User Creation Sync Functionality is supported only for 'LDAP Extended' profile.

        6) After the job has run check the following to ensure the synchronization completed properly:

                1) Optionally review '/opt/collabnet/teamforge/log/app/server.log' for indication of synchronization activity
                2) Review Admin -> User Groups to see if new groups were created
		3) Review Admin -> Users, to see new user is created and added to appropriate user group in CTF side.

    2) Enable 'Auto User Creation Sync' Scenario

        STEPS
                a) Complete initial set-up
                b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true
                        2) Set "Enable Group Sync" to true and "Enable User Data Sync" to true.
			3) Set "Auto User Creation Sync" to true
			4) Make the desired LDAP Extended Profile is enabled with 'Use As LDAP Sync Source' and 'Use As Auto User Sync Source' flags. Enable 'Enable User Membership Action' flag in 'User Data Sync' settings.
                        5) Set "User Auto Creation Cron Interval" to '0 0 23 ? * *' or other short interval
                        6) Configure other settings as appropriate
                        7) Click Save
                        8) Wait the cron interval period

        EXPECTED RESULTS
                a) "server.log" log file displays information including output similar to:
                        2014-05-08 01:34:51,241 INFO  [net.collab.ldapsync.jobs.LdapSyncLauncher] (http--127.0.0.1-8080-6) scheduled job [ JobDetail 'DEFAULT.user':
                b) If email is properly configured new discussion post/new tracker artifact should be saved
                c) If other settings are configured properly, then users should created properly and added to appropriate user group in CTF side.

    3) Disable 'Auto User Creation Sync' Scenario

        STEPS
                a) Complete initial set-up
                b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true
                        2) Set "Enable Group Sync" to true and "Enable User Data Sync" to true.
                        3) Set "Auto User Creation Sync" to false
                        4) Make the desired LDAP Extended Profile is enabled with 'Use As LDAP Sync Source' and 'Use As Auto User Sync Source' flags. Enable 'Enable User Membership Action' flag in 'User Data Sync' settings.
                        5) Set "User Auto Creation Cron Interval" to '0 0 23 ? * *' or other short interval
                        6) Configure other settings as appropriate
                        7) Click Save
                        8) Wait the cron interval period

	EXPECTED RESULTS: Auto User Creation Sync should NOT be run and no reports should be generated for auto user creation sync. This can be verified in server.log.

    4) Disable 'Auto User Creation Sync' Scenario

        STEPS
                a) Complete initial set-up
                b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true
                        2) Set "Enable Group Sync" to false and "Enable User Data Sync" to true.
                        3) Set "Auto User Creation Sync" to true
                        4) Make the desired LDAP Extended Profile is enabled with 'Use As LDAP Sync Source' and 'Use As Auto User Sync Source' flags. Enable 'Enable User Membership Action' flag in 'User Data Sync' settings.
                        5) Set "User Auto Creation Cron Interval" to '0 0 23 ? * *' or other short interval
                        6) Configure other settings as appropriate
                        7) Click Save
                        8) Wait the cron interval period

	EXPECTED RESULTS: Auto User Creation Sync should NOT be run and no reports should be generated for auto user creation sync. This can be verified in server.log.

    5) Disable 'Auto User Creation Sync' Scenario

        STEPS
                a) Complete initial set-up
                b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true
                        2) Set "Enable Group Sync" to true and "Enable User Data Sync" to false.
                        3) Set "Auto User Creation Sync" to true
                        4) Make the desired LDAP Extended Profile is enabled with 'Use As LDAP Sync Source' and 'Use As Auto User Sync Source' flags. Enable 'Enable User Membership Action' flag in 'User Data Sync' settings.
                        5) Set "User Auto Creation Cron Interval" to '0 0 23 ? * *' or other short interval
                        6) Configure other settings as appropriate
                        7) Click Save
                        8) Wait the cron interval period

        EXPECTED RESULTS: Auto User Creation Sync should NOT be run and no reports should be generated for auto user creation sync. This can be verified in server.log.

    6) Disable 'Auto User Creation Sync' Scenario

        STEPS
                a) Complete initial set-up
                b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true
                        2) Set "Enable Group Sync" to true and "Enable User Data Sync" to true.
                        3) Set "Auto User Creation Sync" to true
                        4) Make the desired LDAP Extended Profile is enabled with 'Use As LDAP Sync Source' flag and 'Use As Auto User Sync Source' flags is disabled. Enable 'Enable User Membership Action' flag in 'User Data Sync' settings.
                        5) Set "User Auto Creation Cron Interval" to '0 0 23 ? * *' or other short interval
                        6) Configure other settings as appropriate
                        7) Click Save
                        8) Wait the cron interval period

	EXPECTED RESULTS: Auto User Creation Sync should NOT be run and reports with less data should be generated for auto user creation sync. This can be verified in server.log.

    7) Disable 'Auto User Creation Sync' Scenario

        STEPS
                a) Complete initial set-up
                b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true
                        2) Set "Enable Group Sync" to true and "Enable User Data Sync" to true.
                        3) Set "Auto User Creation Sync" to true
                        4) Make the desired LDAP Extended Profile is enabled with 'Use As Auto User Sync Source' flag and 'Use As LDAP Sync Source' flags is disabled. Enable 'Enable User Membership Action' flag in 'User Data Sync' settings.
                        5) Set "User Auto Creation Cron Interval" to '0 0 23 ? * *' or other short interval
                        6) Configure other settings as appropriate
                        7) Click Save
                        8) Wait the cron interval period

        EXPECTED RESULTS: Auto User Creation Sync should NOT be run and reports with less data should be generated for auto user creation sync. This can be verified in server.log.

    8) Disable 'Auto User Creation Sync' Scenario

        STEPS
                a) Complete initial set-up
                b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true
                        2) Set "Enable Group Sync" to true and "Enable User Data Sync" to true.
                        3) Set "Auto User Creation Sync" to true
                        4) Make the desired LDAP Extended Profile is enabled with 'Use As Auto User Sync Source' flag and 'Use As LDAP Sync Source' flags. Disable 'Enable User Membership Action' flag in 'User Data Sync' settings.
                        5) Set "User Auto Creation Cron Interval" to '0 0 23 ? * *' or other short interval
                        6) Configure other settings as appropriate
                        7) Click Save
                        8) Wait the cron interval period

        EXPECTED RESULTS: Auto User Creation Sync should NOT be run and reports with less data should be generated for auto user creation sync. This can be verified in server.log.

    9) Basic 'Auto User Creation Sync' Scenario - user in AD/LDAP has proper Fullname and email

        STEPS
                a) Complete initial set-up
                b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true
                        2) Set "Enable Group Sync" to true and Set 'Group Search Filter Arguments' to 'Team*,CTF*' and "Enable User Data Sync" to true.
                        3) Set "Auto User Creation Sync" to true
                        4) Make the desired LDAP Extended Profile is enabled with 'Use As LDAP Sync Source' and 'Use As Auto User Sync Source' flags. Enable 'Enable User Membership Action' flag in 'User Data Sync' settings.
                        5) Set "User Auto Creation Cron Interval" to '0 0 23 ? * *' or other short interval
                        6) Configure other settings as appropriate say ('ALM' as License, 'en' as Locale, 'PST' as Timezone, '0' as 'Create As SiteAdmin' and '1' as 'Create As Restricted User', '*' as 'Allowed Groups')
                        7) Click Save
                        8) Wait the cron interval period

        EXPECTED RESULTS
                a) "server.log" log file displays information including output similar to:
			2018-02-22 11:42:42,767 INFO  [net.collab.ldapsync.jobs.LdapSyncLauncher] (Thread-1192257) scheduled job [ JobDetail 'LDAPSYNC.user':  jobClass: 'net.collab.ldapsync.jobs.UserSyncJob isStateful: true isVolatile: false isDurable: false requestsRecovers: false ] with [ Trigger 'LDAPSYNC.ldap.sync.user.cron.trigger':  triggerClass: 'org.quartz.CronTrigger isVolatile: false calendar: 'null' misfireInstruction: 0 nextFireTime: Thu Feb 22 23:00:00 IST 2018 ]
			2018-02-22 11:42:49,766 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job start: Thu Feb 22 11:42:49 IST 2018
			2018-02-22 11:42:53,585 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job finish: Thu Feb 22 11:42:53 IST 2018
                b) If settings are configured properly, then users should created properly in CTF side and added to appropriate user group in CTF side. User Data is as follows

			Username - This will be as per the baseFilter in the respective 'LDAP Extended'profile.
			Fullname - This comes from AD/LDAP based on the individual mapping for Fullname.
			Email - This comes from AD/LDAP based on the individual mapping for Email.
			Organisation - This comes from AD/LDAP based on the individual mapping for Organisation. 
			Locale - This comes from 'Auto User Creation Sync Settings' in UI. In our case it will be 'en'.
			License Type - This comes from 'Auto User Creation Sync Settings' in UI. In our case it will be 'ALM'.
			Timezone - This comes from 'Auto User Creation Sync Settings' in UI. In our case it will be 'PST'.
			Is Site Admin - This comes from 'Auto User Creation Sync Settings' in UI. In our case it will be '0'.
			Is Restricted User - This comes from 'Auto User Creation Sync Settings' in UI. In our case it will be '1'.
			Allowed Groups - All groups from group sync configuration will be considered for auto creation i.e. users from all the groups from group sync configuration which are not present in CTF will be created.

		c) Then the created user should be added to the appropriate user group in CTF side. In our case those group which start with 'Team' or 'CTF'
			
                d) If report setting/email is properly configured new discussion post/new tracker artifact should be saved with a new attachment for 'Auto User Creation Sync' in addition to existing attachments.


    10) Basic 'Auto User Creation Sync' Scenario - user in AD/LDAP has proper Fullname but no email

        STEPS
                a) Complete initial set-up
                b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true
                        2) Set "Enable Group Sync" to true and Set 'Group Search Filter Arguments' to 'Team*,CTF*' and "Enable User Data Sync" to true.
                        3) Set "Auto User Creation Sync" to true
                        4) Make the desired LDAP Extended Profile is enabled with 'Use As LDAP Sync Source' and 'Use As Auto User Sync Source' flags. Enable 'Enable User Membership Action' flag in 'User Data Sync' settings.
                        5) Set "User Auto Creation Cron Interval" to '0 0 23 ? * *' or other short interval
                        6) Configure other settings as appropriate say ('ALM' as License, 'en' as Locale, 'PST' as Timezone, '0' as 'Create As SiteAdmin' and '1' as 'Create As Restricted User', '*' as 'Allowed Groups')
                        7) Click Save
                        8) Wait the cron interval period

        EXPECTED RESULTS
                a) "server.log" log file displays information including output similar to:
                        2018-02-22 11:42:42,767 INFO  [net.collab.ldapsync.jobs.LdapSyncLauncher] (Thread-1192257) scheduled job [ JobDetail 'LDAPSYNC.user':  jobClass: 'net.collab.ldapsync.jobs.UserSyncJob isStateful: true isVolatile: false isDurable: false requestsRecovers: false ] with [ Trigger 'LDAPSYNC.ldap.sync.user.cron.trigger':  triggerClass: 'org.quartz.CronTrigger isVolatile: false calendar: 'null' misfireInstruction: 0 nextFireTime: Thu Feb 22 23:00:00 IST 2018 ]
                        2018-02-22 11:42:49,766 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job start: Thu Feb 22 11:42:49 IST 2018
                        2018-02-22 11:42:53,585 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job finish: Thu Feb 22 11:42:53 IST 2018
                b) Users should NOT be created and should NOT added to appropriate user group in CTF side.

                c) If report setting/email is properly configured new discussion post/new tracker artifact with less data should be saved with a new attachment for 'Auto User Creation Sync' in addition to existing attachments.


    11) Basic 'Auto User Creation Sync' Scenario - user in AD/LDAP has proper email but no fullname

        STEPS
                a) Complete initial set-up
                b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true
                        2) Set "Enable Group Sync" to true and Set 'Group Search Filter Arguments' to 'Team*,CTF*' and "Enable User Data Sync" to true.
                        3) Set "Auto User Creation Sync" to true
                        4) Make the desired LDAP Extended Profile is enabled with 'Use As LDAP Sync Source' and 'Use As Auto User Sync Source' flags. Enable 'Enable User Membership Action' flag in 'User Data Sync' settings.
                        5) Set "User Auto Creation Cron Interval" to '0 0 23 ? * *' or other short interval
                        6) Configure other settings as appropriate say ('ALM' as License, 'en' as Locale, 'PST' as Timezone, '0' as 'Create As SiteAdmin' and '1' as 'Create As Restricted User', '*' as 'Allowed Groups')
                        7) Click Save
                        8) Wait the cron interval period

        EXPECTED RESULTS
                a) "server.log" log file displays information including output similar to:
                        2018-02-22 11:42:42,767 INFO  [net.collab.ldapsync.jobs.LdapSyncLauncher] (Thread-1192257) scheduled job [ JobDetail 'LDAPSYNC.user':  jobClass: 'net.collab.ldapsync.jobs.UserSyncJob isStateful: true isVolatile: false isDurable: false requestsRecovers: false ] with [ Trigger 'LDAPSYNC.ldap.sync.user.cron.trigger':  triggerClass: 'org.quartz.CronTrigger isVolatile: false calendar: 'null' misfireInstruction: 0 nextFireTime: Thu Feb 22 23:00:00 IST 2018 ]
                        2018-02-22 11:42:49,766 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job start: Thu Feb 22 11:42:49 IST 2018
                        2018-02-22 11:42:53,585 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job finish: Thu Feb 22 11:42:53 IST 2018
                b) Users should NOT be created and should NOT added to appropriate user group in CTF side. 

                c) If report setting/email is properly configured new discussion post/new tracker artifact with less data should be saved with a new attachment for 'Auto User Creation Sync' in addition to existing attachments.


    12) Basic 'Auto User Creation Sync' Scenario - user in AD/LDAP has proper Fullname and email

        STEPS
                a) Complete initial set-up
                b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true
                        2) Set "Enable Group Sync" to true and Set 'Group Search Filter Arguments' to 'Team*,CTF*' and "Enable User Data Sync" to true.
                        3) Set "Auto User Creation Sync" to true
                        4) Make the desired LDAP Extended Profile is enabled with 'Use As LDAP Sync Source' and 'Use As Auto User Sync Source' flags. Enable 'Enable User Membership Action' flag in 'User Data Sync' settings.
                        5) Set "User Auto Creation Cron Interval" to '0 0 23 ? * *' or other short interval
                        6) Configure other settings as appropriate say ('SCM' as License, 'ko' as Locale, 'IST' as Timezone, '1' as 'Create As SiteAdmin' and '0' as 'Create As Restricted User', '*' as 'Allowed Groups')
                        7) Click Save
                        8) Wait the cron interval period

        EXPECTED RESULTS
                a) "server.log" log file displays information including output similar to:
                        2018-02-22 11:42:42,767 INFO  [net.collab.ldapsync.jobs.LdapSyncLauncher] (Thread-1192257) scheduled job [ JobDetail 'LDAPSYNC.user':  jobClass: 'net.collab.ldapsync.jobs.UserSyncJob isStateful: true isVolatile: false isDurable: false requestsRecovers: false ] with [ Trigger 'LDAPSYNC.ldap.sync.user.cron.trigger':  triggerClass: 'org.quartz.CronTrigger isVolatile: false calendar: 'null' misfireInstruction: 0 nextFireTime: Thu Feb 22 23:00:00 IST 2018 ]
                        2018-02-22 11:42:49,766 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job start: Thu Feb 22 11:42:49 IST 2018
                        2018-02-22 11:42:53,585 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job finish: Thu Feb 22 11:42:53 IST 2018
                b) If settings are configured properly, then users should created properly and added to appropriate user group in CTF side. User Data is as follows

                        Username - This will be as per the baseFilter in the respective 'LDAP Extended'profile.
                        Fullname - This comes from AD/LDAP based on the individual mapping for Fullname.
                        Email - This comes from AD/LDAP based on the individual mapping for Email.
                        Organisation - This comes from AD/LDAP based on the individual mapping for Organisation.
                        Locale - This comes from 'Auto User Creation Sync Settings' in UI. In our case it will be 'ko'.
                        License Type - This comes from 'Auto User Creation Sync Settings' in UI. In our case it will be 'SCM'.
                        Timezone - This comes from 'Auto User Creation Sync Settings' in UI. In our case it will be 'IST'.
                        Is Site Admin - This comes from 'Auto User Creation Sync Settings' in UI. In our case it will be '1'.
                        Is Restricted User - This comes from 'Auto User Creation Sync Settings' in UI. In our case it will be '0'.
			Allowed Groups - All groups from group sync configuration will be considered for auto creation i.e. users from all the groups from group sync configuration which are not present in CTF will be created.

                c) Then the created user should be added to the appropriate user group in CTF side. In our case those group which start with 'Team' or 'CTF'

                d) If report setting/email is properly configured new discussion post/new tracker artifact should be saved with a new attachment for 'Auto User Creation Sync' in addition to existing attachments.


    13) Basic 'Auto User Creation Sync' Scenario - user in AD/LDAP has proper Fullname and email - Report Content

        STEPS
                a) Complete initial set-up
                b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true
                        2) Set "Enable Group Sync" to true and Set 'Group Search Filter Arguments' to 'Team*,CTF*' and "Enable User Data Sync" to true.
                        3) Set "Auto User Creation Sync" to true
                        4) Make the desired LDAP Extended Profile is enabled with 'Use As LDAP Sync Source' and 'Use As Auto User Sync Source' flags. Enable 'Enable User Membership Action' flag in 'User Data Sync' settings.
                        5) Set "User Auto Creation Cron Interval" to '0 0 23 ? * *' or other short interval
                        6) Configure other settings as appropriate say ('ALM' as License, 'en' as Locale, 'PST' as Timezone, '0' as 'Create As SiteAdmin' and '1' as 'Create As Restricted User', '*' as 'Allowed Groups')
                        7) Click Save
                        8) Wait the cron interval period
			9) Check the Report Content.

        EXPECTED RESULTS
                a) "server.log" log file displays information including output similar to:
                        2018-02-22 11:42:42,767 INFO  [net.collab.ldapsync.jobs.LdapSyncLauncher] (Thread-1192257) scheduled job [ JobDetail 'LDAPSYNC.user':  jobClass: 'net.collab.ldapsync.jobs.UserSyncJob isStateful: true isVolatile: false isDurable: false requestsRecovers: false ] with [ Trigger 'LDAPSYNC.ldap.sync.user.cron.trigger':  triggerClass: 'org.quartz.CronTrigger isVolatile: false calendar: 'null' misfireInstruction: 0 nextFireTime: Thu Feb 22 23:00:00 IST 2018 ]
                        2018-02-22 11:42:49,766 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job start: Thu Feb 22 11:42:49 IST 2018
                        2018-02-22 11:42:53,585 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job finish: Thu Feb 22 11:42:53 IST 2018
                b) If settings are configured properly, then users should created properly and added to appropriate user group in CTF side.

                c) If report setting/email is properly configured new discussion post/new tracker artifact should be saved with a new attachment for 'Auto User Creation Sync' in addition to existing attachments. This can be sent as normal mail to a email-ids also.

			Report Content will be similar to 

				"LDAPSync Run Report" - Auto Creation Sync job  
				################################################################### 
				#### Auto Creation Sync Job started: Tue Feb 20 10:50:33 IST 2018.   
				#### Auto CreationSync Job finished: Tue Feb 20 10:50:39 IST 2018. 
				################################################################### 
				#### Summary 
				################################################################### 
				User Created = 0 ###################### 
				################################################################### 

			Attachment Content will be similar to

				User 'certuser1' created.
				User 'certuser1' added to the group 'TeamGrp1'
				User 'certuser2' not created.
				User 'certuser3' Not added to the group 'TeamGrp1'


    14) Basic 'Auto User Creation Sync' Scenario - user in AD/LDAP has proper Fullname and email with '*' as 'Group Search Filter Arguments'
	
        STEPS
                a) Complete initial set-up
                b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true
                        2) Set "Enable Group Sync" to true and Set 'Group Search Filter Arguments' to '*' and "Enable User Data Sync" to true.
                        3) Set "Auto User Creation Sync" to true
                        4) Make the desired LDAP Extended Profile is enabled with 'Use As LDAP Sync Source' and 'Use As Auto User Sync Source' flags. Enable 'Enable User Membership Action' flag in 'User Data Sync' settings.
                        5) Set "User Auto Creation Cron Interval" to '0 0 23 ? * *' or other short interval
                        6) Configure other settings as appropriate say ('ALM' as License, 'en' as Locale, 'PST' as Timezone, '0' as 'Create As SiteAdmin' and '1' as 'Create As Restricted User', '*' as 'Allowed Groups')
                        7) Click Save
                        8) Wait the cron interval period

        EXPECTED RESULTS

		a) Important: A warning message 'Note: If this value is '*' and Auto Creation is enabled, then avalanche of auto user creation will happen. Beware.' should be given in red next to 'Group Search Filter Arguments' field in UI under look project -> Authentication Manager -> LDAP Sync -> Group Sync Settings as well as tooltip for 'Group Search Filter Arguments'. 

                b) "server.log" log file displays information including output similar to:
                        2018-02-22 11:42:42,767 INFO  [net.collab.ldapsync.jobs.LdapSyncLauncher] (Thread-1192257) scheduled job [ JobDetail 'LDAPSYNC.user':  jobClass: 'net.collab.ldapsync.jobs.UserSyncJob isStateful: true isVolatile: false isDurable: false requestsRecovers: false ] with [ Trigger 'LDAPSYNC.ldap.sync.user.cron.trigger':  triggerClass: 'org.quartz.CronTrigger isVolatile: false calendar: 'null' misfireInstruction: 0 nextFireTime: Thu Feb 22 23:00:00 IST 2018 ]
                        2018-02-22 11:42:49,766 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job start: Thu Feb 22 11:42:49 IST 2018
                        2018-02-22 11:42:53,585 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job finish: Thu Feb 22 11:42:53 IST 2018
                c) If settings are configured properly, then users from all the groups in AD/LDAP side should created properly and added to appropriate user group in CTF side.

                d) If report setting/email is properly configured new discussion post/new tracker artifact should be saved with a new attachment for 'Auto User Creation Sync' in addition to existing attachments.


    15) Basic 'Auto User Creation Sync' Scenario - user in AD/LDAP has proper Fullname and email with Mapping functionality.

        STEPS
                a) Complete initial set-up
                b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true
                        2) Set "Enable Group Sync" to true and Set 'Group Search Filter Arguments' to 'Team*,CTF*' and "Enable User Data Sync" to true.
                        3) Set "Auto User Creation Sync" to true
                        4) Make the desired LDAP Extended Profile is enabled with 'Use As LDAP Sync Source' and 'Use As Auto User Sync Source' flags. Also provide a proper field mapping for fullName, email, organisation. Enable 'Enable User Membership Action' flag in 'User Data Sync' settings.
                        5) Set "User Auto Creation Cron Interval" to '0 0 23 ? * *' or other short interval
                        6) Configure other settings as appropriate say ('ALM' as License, 'en' as Locale, 'PST' as Timezone, '0' as 'Create As SiteAdmin' and '1' as 'Create As Restricted User', '*' as 'Allowed Groups')
                        7) Click Save
                        8) Wait the cron interval period

        EXPECTED RESULTS

                a) "server.log" log file displays information including output similar to:
                        2018-02-22 11:42:42,767 INFO  [net.collab.ldapsync.jobs.LdapSyncLauncher] (Thread-1192257) scheduled job [ JobDetail 'LDAPSYNC.user':  jobClass: 'net.collab.ldapsync.jobs.UserSyncJob isStateful: true isVolatile: false isDurable: false requestsRecovers: false ] with [ Trigger 'LDAPSYNC.ldap.sync.user.cron.trigger':  triggerClass: 'org.quartz.CronTrigger isVolatile: false calendar: 'null' misfireInstruction: 0 nextFireTime: Thu Feb 22 23:00:00 IST 2018 ]
                        2018-02-22 11:42:49,766 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job start: Thu Feb 22 11:42:49 IST 2018
                        2018-02-22 11:42:53,585 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job finish: Thu Feb 22 11:42:53 IST 2018
                b) If settings are configured properly, then user in AD/LDAP side should created properly in CTF side and added to appropriate user group in CTF side. 

		c) When user is created the fullname, Email and Organisation should stick their field mapping described in the respective individual 'LDAP Extended' profile.

                d) If report setting/email is properly configured new discussion post/new tracker artifact should be saved with a new attachment for 'Auto User Creation Sync' in addition to existing attachments.



    16) Basic 'Auto User Creation Sync' Scenario - user in AD/LDAP has proper Fullname and email but WRONG Mapping in CTF side.

	STEPS
                a) Complete initial set-up
                b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true
                        2) Set "Enable Group Sync" to true and Set 'Group Search Filter Arguments' to 'Team*,CTF*' and "Enable User Data Sync" to true.
                        3) Set "Auto User Creation Sync" to true
                        4) Make the desired LDAP Extended Profile is enabled with 'Use As LDAP Sync Source' and 'Use As Auto User Sync Source' flags. Also provide a WRONG field mapping for fullName, email, organisation.  Enable 'Enable User Membership Action' flag in 'User Data Sync' settings.
                        5) Set "User Auto Creation Cron Interval" to '0 0 23 ? * *' or other short interval
                        6) Configure other settings as appropriate say ('ALM' as License, 'en' as Locale, 'PST' as Timezone, '0' as 'Create As SiteAdmin' and '1' as 'Create As Restricted User', '*' as 'Allowed Groups')
                        7) Click Save
                        8) Wait the cron interval period

        EXPECTED RESULTS
                a) "server.log" log file displays information including output similar to:
                        2018-02-22 11:42:42,767 INFO  [net.collab.ldapsync.jobs.LdapSyncLauncher] (Thread-1192257) scheduled job [ JobDetail 'LDAPSYNC.user':  jobClass: 'net.collab.ldapsync.jobs.UserSyncJob isStateful: true isVolatile: false isDurable: false requestsRecovers: false ] with [ Trigger 'LDAPSYNC.ldap.sync.user.cron.trigger':  triggerClass: 'org.quartz.CronTrigger isVolatile: false calendar: 'null' misfireInstruction: 0 nextFireTime: Thu Feb 22 23:00:00 IST 2018 ]
                        2018-02-22 11:42:49,766 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job start: Thu Feb 22 11:42:49 IST 2018
                        2018-02-22 11:42:53,585 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job finish: Thu Feb 22 11:42:53 IST 2018
                b) Users should NOT be created and should NOT added to appropriate user group in CTF side.

                c) If report setting/email is properly configured new discussion post/new tracker artifact with less data should be saved with a new attachment for 'Auto User Creation Sync' in addition to existing attachments.


    17) Basic 'Auto User Creation Sync' Scenario - user in AD/LDAP has proper Fullname and email with specific 'Allowed Groups'.

        STEPS
                a) Complete initial set-up
                b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true
                        2) Set "Enable Group Sync" to true and Set 'Group Search Filter Arguments' to 'Team*,CTF*' and "Enable User Data Sync" to true.
                        3) Set "Auto User Creation Sync" to true
                        4) Make the desired LDAP Extended Profile is enabled with 'Use As LDAP Sync Source' and 'Use As Auto User Sync Source' flags. Enable 'Enable User Membership Action' flag in 'User Data Sync' settings.
                        5) Set "User Auto Creation Cron Interval" to '0 0 23 ? * *' or other short interval
                        6) Configure other settings as appropriate say ('ALM' as License, 'en' as Locale, 'PST' as Timezone, '0' as 'Create As SiteAdmin' and '1' as 'Create As Restricted User', 'CTFGrp1,CTFGrp2' as 'Allowed Groups')
                        7) Click Save
                        8) Wait the cron interval period

        EXPECTED RESULTS

                a) "server.log" log file displays information including output similar to:
                        2018-02-22 11:42:42,767 INFO  [net.collab.ldapsync.jobs.LdapSyncLauncher] (Thread-1192257) scheduled job [ JobDetail 'LDAPSYNC.user':  jobClass: 'net.collab.ldapsync.jobs.UserSyncJob isStateful: true isVolatile: false isDurable: false requestsRecovers: false ] with [ Trigger 'LDAPSYNC.ldap.sync.user.cron.trigger':  triggerClass: 'org.quartz.CronTrigger isVolatile: false calendar: 'null' misfireInstruction: 0 nextFireTime: Thu Feb 22 23:00:00 IST 2018 ]
                        2018-02-22 11:42:49,766 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job start: Thu Feb 22 11:42:49 IST 2018
                        2018-02-22 11:42:53,585 INFO  [net.collab.ldapsync.UserSync] (DefaultQuartzScheduler_Worker-3) net.collab.ldapsync.UserSync job finish: Thu Feb 22 11:42:53 IST 2018
                b) If settings are configured properly, then users should created properly and added to appropriate user group in CTF side. User Data is as follows

                        Username - This will be as per the baseFilter in the respective 'LDAP Extended'profile.
                        Fullname - This comes from AD/LDAP based on the individual mapping for Fullname.
                        Email - This comes from AD/LDAP based on the individual mapping for Email.
                        Organisation - This comes from AD/LDAP based on the individual mapping for Organisation.
                        Locale - This comes from 'Auto User Creation Sync Settings' in UI. In our case it will be 'ko'.
                        License Type - This comes from 'Auto User Creation Sync Settings' in UI. In our case it will be 'SCM'.
                        Timezone - This comes from 'Auto User Creation Sync Settings' in UI. In our case it will be 'IST'.
                        Is Site Admin - This comes from 'Auto User Creation Sync Settings' in UI. In our case it will be '1'.
                        Is Restricted User - This comes from 'Auto User Creation Sync Settings' in UI. In our case it will be '0'.

                        IMPORTANT: Allowed Groups - We will filter the Groups List which we get from Group Sync configuration base on this value. Say Group Sync configuration is CTF* and there are CTFGrp1,CTFGrp2,CTFGrp3,CTFGrp4 groups in AD/LDAP and we have 'CTFGrp1,CTFGrp2' as Allowed Groups, then we will consider only CTFGrp1,CTFGrp2 for auto creation functionality i.e. users from 'CTFGrp1,CTFGrp2' group alone which are not present in CTF will be created.

                c) If report setting/email is properly configured new discussion post/new tracker artifact should be saved with a new attachment for 'Auto User Creation Sync' in addition to existing attachments.


    18) Basic 'Auto User Creation Sync' Scenario - Disable User Registration from UI.

	STEPS
		1) Login to CTF as site admin.
		2) Go to Admin -> System Tools -> Configure Application -> External Authentication
		3) Enable 'ENABLE LDAP SELF REGISTRATION' token.
                4) Click Save.
                5) Logout from CTF.
                6) Login with a new user who is present in AD/LDAP with valid credentials.

        EXPECTED RESULTS

                a) User should be taken to the 'createAuthenticatedUser' page.

		7) Login as site-admin and Disable ENABLE LDAP SELF REGISTRATION' token.
		8) Click Save.
		9) Logout from CTF.
		10) Login with a new user who is present in AD/LDAP with valid credentials.

        EXPECTED RESULTS

                b) User should NOT be taken to the 'createAuthenticatedUser' page and an error message 'You do not have an account on TeamForge, please contact your TeamForge administrator to request an account.' should be thrown in login page.

                11) Login with a non-existing user who is NOT present in AD/LDAP or with a wrong credentials for a new user who is present in AD/LDAP.

        EXPECTED RESULTS

                c) A core login failure message should be thrown.

                12) Login as site-admin and Enable 'ENABLE LDAP SELF REGISTRATION' token.
                13) Click Save.
                14) Logout from CTF.
                15) Login with a non-existing user who is NOT present in AD/LDAP or with a wrong credentials for a new user who is present in AD/LDAP.

        EXPECTED RESULTS

                d) A core login failure message should be thrown.				


    19) Log Level settings

	STEPS
                a) Complete initial set-up
                b) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set "Enable Sync" to true
                        2) Set "Enable Group Sync" to true and Set 'Group Search Filter Arguments' to 'Team*,CTF*'
                        3) Set "Auto User Creation Sync" to true
                        4) Make the desired LDAP Extended Profile is enabled with 'Use As LDAP Sync Source' and 'Use As Auto User Sync Source' flags.
                        5) Set "User Auto Creation Cron Interval" to '0 0 23 ? * *' or other short interval
                        6) Configure other settings as appropriate say ('ALM' as License, 'en' as Locale, 'PST' as Timezone, '0' as 'Create As SiteAdmin' and '1' as 'Create As Restricted User')
                        7) Click Save
			8) Enable FINE/FINEST/DEBUG logs using the following commands

				/opt/collabnet/teamforge/runtime/jboss/bin/jboss-cli.sh -c --command='/subsystem=logging/logger=net.collab.ldapsync.util.LightweightDirectory:add(level=FINEST,handlers=["FILE"])'
				/opt/collabnet/teamforge/runtime/jboss/bin/jboss-cli.sh -c --command='/subsystem=logging/logger=net.collab.ldapsync.UserSync:add(level=FINEST,handlers=["FILE"])'
                        9) Wait the cron interval period

        EXPECTED RESULTS

		a) More logs should appear in server.log. This will be useful while debugging.


     20) Auto Creation functionality should abide Mapping Rules. For now we are supporting IBM LDAP And LDAP/AD.



 Miscellaneous Testcases
 -----------------------

	1) Auto start of LDAP Sync

		a) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
			1) Set 'Enable Sync' to true.
			2) Save
		b) Restart jboss

		EXPECTED RESULTS: LDAP Sync should be started automatically when jboss comes up. Check this in look project -> Authentication Manager -> LDAP Sync

		c) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Set 'Enable Sync' to false.
                        2) Save

		b) Restart jboss

                EXPECTED RESULTS: LDAP Sync should NOT be started at all when jboss comes up. Check this in look project -> Authentication Manager -> LDAP Sync


	2) User Data Sync for 'admin', deleted and local user in both split and non-split cases

		1. 'admin' and deleted user should not be considered for user data sync and this can be checked in server.log

		2. Local user should not be considered for user data sync and this can be checked in server.log . 

		   To make a user local, please do the following,

		   a) Enable 'USE FEDERATED LOGIN' in Admin -> Identity -> Federation and selecting 'LDAP' as 'SELECT IDP' and enable 'ENABLE LOCAL USER' in Admin -> System Tools -> Configure Application -> External Authentication.
		   b) Go to Edit user page of desired user and enable 'Local User'.


	3) User - AD Server tracking
		
		a) Complete initial set-up. Set Enable Sync and Enable User Data Sync to 'true'.
        	b) Make sure you have atleast few (say 3) active/disabled users for which this is the first run.
        	c) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
        	        1) Configure all settings as appropriate
                	2) Click Save
	                3) Click Stop and Click Start
        	        4) Click 'Run Once'

                	EXPECTED RESULTS: In the first run, all the configured AD servers should be queried for all the 3 users and we need to store the AD Server which has given successful return/response for these users in IDS. This can be verified using sql query "select * from integration_data_value where name='authenticated.ldap' and object_id='userid';";

	                5) Again click 'Run Once'

        	        EXPECTED RESULTS: In the second run, we need to query the respective AD server (from IDS) and we should not query other AD servers. This can be verified in server.log

			Change in provider url in any of the 'Extended LDAP' profile
			------------------------------------------------------------

			Typical usecase will be customer may changed the LDAP/AD provider URL from HTTP to HTTPS. Sometime they may changes the entire url itself.

			6) Change the 'java.naming.provider.url' value in one of the 'Extended LDAP' profile and Save.
			7) Again click 'Run Once'
	
			EXPECTED RESULTS: 'AD Server tracking' cache will be cleared from IDS and all the users will be queried across all the profiles for the current Sync and the next Sync. This can be verified in the server.log and IDS using the same sql query.


	4) Non Existing LDAP/AD and LDAP Sync Completion

		a) Complete initial set-up. Set Enable Sync and Enable User Data Sync to 'true'.
		b) Make sure you have atleast few (say 3) active users/disabled users for which this is the first run.
		c) Make sure you have only one LDAP Extended profile whose URL is 'ldap://1.2.3.4:567/' - a non existing LDAP/AD.
		d) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
                        1) Configure all settings as appropriate
                        2) Click Save
                        3) Click Stop and Click Start
                        4) Click 'Run Once'

		EXPECTED RESULTS: LDAP Sync should run for all the 3 users and it should not come out of the run after the first user failure. Exception should be thrown for all the 3 user and this can be verified in server.log.


	5) Performance Testing

		a) Do a ldap user data sync with 35000 users in CTF side.

		EXPECTED RESULTS: Run should be completed without any issues. No Session Timeout exception and Connection Timeout exception should be thrown consistently. Even if it is thrown inconsistently, ldap sync run should continue and it should not come out of the run.

	6) Test in SCM Mode

		As of now the following feature won't work in SCM Mode

			1) LDAP Mailing feature won't work for tracker ids.


	7) No internal links in authentication manager screen (linked app) should be accessed directly in a new browser window/tab by the user. It should take the user to login page if they are not logged in else they should be taken to home page. Some internal links are,

                a) http://<box>/authenticationManager
                b) http://<box>/authenticationManager/read/profiles
                c) http://<box>/authenticationManager/upgrade
                d) http://<box>/authenticationManager/create/profile
                e) http://<box>/authenticationManager/read/static

                etc.



Debugging Section
-----------------


	1. A sample ldap search command (under debug folder) is attached for debugging purpose. A file ldap-search.sh is attached along with the RPM. Edit it and modify with the required correct details. It should fetch the result successfully.

	2. A mock script 'debug/testAuthenticatedUser' which imitates Selective Sync script and Create Authenticated User script has been included for debugging. Execute the script as

		a. ./debug/testAuthenticatedUser <username>

		b. It should create a log file as '/opt/collabnet/teamforge/log/add-ons/test_newuser_registration.log' with sufficient details.

	3. Execute the debug script (a perl based script) as follows

		./debug/GetLdapInfo <LDAP URL> <bindDN> <bindCredential> <baseDN> <searchString> <searchValue> > a.txt
	
		Sample: ./debug/GetLdapInfo 'ldap://10.2.1.1:389/' 'cn=testuser,cn=Users,dc=xyz,dc=corp,dc=abc,dc=net' 'Abcdef123!' 'cn=Users,dc=xyz,dc=corp,dc=abc,dc=net' 'cn' 'world*' > a.txt

	4. Java based validator debug script

		a. This will perform what the 'Validate' button do (in UI) in the backend as standalone program.

		b. This will check the following,

			i) Authentication for bind credentials.

		       ii) Search result for the complete 'LDAP Extended' profile settings.

		      iii) Will fetch LDAP details namely fullname, email and organisation for the searched user.

		c. Execute the script as follows,

		   	i) cd /opt/collabnet/teamforge/add-ons/ctf_authentication_manager/debug/

		       ii) ./LdapValidator.sh

		   This will be executed in non-interactive mode with some test data. 


		d. Non-interactive mode: Change the test data to appropriate data and re-run the LdapValidator.sh script in non-interactive mode itself.

		e. Interactive mode: Or you can convert the script into interactive mode by following the step as mentoned in LdapValidator.sh script and re-run the LdapValidator.sh script in interactive mode. 

		f. Execute the script as follows for DEBUG logs,

			i) cd /opt/collabnet/teamforge/add-ons/ctf_authentication_manager/debug/

                       ii) touch debug

		      iii) ./LdapValidator.sh 


	5. Test the above four cases for ldaps site.



  USAGE

	GENERAL - PROFILE CREATION

                1) A Profile contains the "login-module" settings to be applied to JBoss which will be used to determine the authentication method and corresponding settings. To configure authentication you must create 1 or more profiles. To create a new Profile:
                        a) Log-in to the TeamForge web interface as the TeamForge Admin user, "admin"
                        b) Navigate to the look project
                        c) Select the "Authentication Manager" tab in the project button bar
                        d) Select "Create Profile"
                        e) Select one of the supported profile types from the pull-down menu
                        d) Replace the default values and use the existing values as a guide
                        e) Select "Create" button
                        f) If the profile creation was successful you will see a dialog confirming the profile was created.  The profile is NOT yet active.
                        g) On the resulting "Manage Existing Profiles" screen you should see your newly created profile and any existing profiles. If this is the first time creating a profile you will see the default Database Profile has been auto-imported.
                        h) Activate your newly created profile. Note: Your profile will immediately become active once JBoss is restarted for any subsequent log-in or authentication request will pass through this and any other active modules.
			i) At this point it is recommended to delete the "Auto-imported DatabaseAuthenticationBackend" and "Auto-imported LdapAuthenticationBackend"
                        j) Log-out and test the new profile using the appropriate credentials


        CONFIGURE LDAP/AD AUTHENTICATION

                1) To integrate with LDAP/AD Directory services follow the steps outline under "GENERAL - PROFILE CREATION"
                2) When you create a profile, choose the LDAP/AD type appropriate for your server. Note: It is recommendable to use Extended LDAP as profile type as this adds more security and more segregation. Also LDAP Sync will be supported for Extended LDAP profile.
                3) If the LDAP/AD server is SSL protected you may need to import the CA Chain and/or server certificate into the java keystore.


        UPGRADE PROFILES FROM TEAMFORGE 6.0 or prior

                1) Navigate to the Authentication Manager interface as described under USAGE->GENERAL in this document.
                2) Select "Upgrade Legacy Config"
                3) Choose the appropriate option to load the "login-config.xml" file for review and import
                4) For each authentication profile (login-module) you want to import into the CTF 7 select "Save"
                5) Activate the imported profile
                        a)If the profile creation was successful you will see a dialog confirming the profile was created.  The profile is NOT yet active.
                        b) On the resulting "Manage Existing Profiles" screen you should see your newly created profile and any existing profiles.  If this is the first time creating a profile you will see the default Database Profile has been auto-imported.
                        c) Activate your newly created profile. Note: Your profile will immediately become active once JBoss is restarted for any subsequent log-in or authentication request will pass through this and any other active modules.
			d) At this point it is recommended to delete the "Auto-imported DatabaseAuthenticationBackend" and "Auto-imported LdapAuthenticationBackend"
                        e) Log-out and test the new profile using the desired username and the master password set earlier.
                        f) If the profile creation was successful you will see a dialog confirming the profile was created.  The profile is NOT yet active.
                        g) On the resulting "Manage Existing Profiles" screen you should see your newly created profile and any existing profiles.  If this is the first time creating a profile you will see the default Database Profile has been auto-imported.
                        h) Activate your newly created profile. Note: Your profile will immediately become active once JBoss is restarted for any subsequent log-in or authentication request will pass through this and any other active modules.
			i) At this point it is recommended to delete the "Auto-imported DatabaseAuthenticationBackend" and "Auto-imported LdapAuthenticationBackend"
                        j) Log-out and test the new profile using the appropriate credentials


        CONFIGURE MASTER PASSWORD AUTHENTICATION

                1) Set the password:
                         On the command-line, in the add-on installation directory (ex: /opt/collabnet/teamforge/add-ons/ctf_authentication_manager ), run "./scripts/mpasswd.sh"
                2) You will be prompted to enter a "master password" then to confirm that password. The password will be encrypted and stored in "/etc/MasterPassword.properties". When we key-in the master password, it will be masked for security reasons.
                3) Configure the Master password profile:

                        a) Log-in to the TeamForge web interface as the TeamForge Admin user, "admin"
                        b) Navigate to the look project
                        c) Select the "Authentication Manager" tab in the project button bar
                        d) Select "Create Profile"
                        f) Choose "MasterPassword
                        g) Choose a name for the profile
                        h) Set "flag" field to the appropriate value usually "sufficient".
                        i) Click the "Create" button

                4) Activate the Master Password profile

                        a) If the profile creation was successful you will see a dialog confirming the profile was created.  The profile is NOT yet active.
                        b) On the resulting "Manage Profiles" screen you should see your newly created profile and any existing profiles.  If this is the first time creating a profile you will see the default Database Profile has been auto-imported.
                        c) Activate your newly created profile. Note: Your profile will immediately become active once JBoss is restarted for any subsequent log-in or authentication request will pass through this and any other active modules.
			d) At this point it is recommended to delete the "Auto-imported DatabaseAuthenticationBackend" and "Auto-imported LdapAuthenticationBackend"
                        e) Log-out and test the new profile using the desired username and the master password set earlier.


   CONFIGURATION AND USAGE OF LDAP SYNC


       1) First to establish the servers to sync user and/or group data from, do the following:

		a) In the web interface Navigate to the look project -> Authentication Manager -> Manage Existing Profiles
		b) Expand the accordion for the server you wish to sync from
		c) Select “Edit”
		d) Set “Use As LDAP Sync Source” to “true”
		e) If syncing groups, set the “roleCtxDN” to the distinguished name of the object (CN, or OU) holding the Roles/Group information.  For Active Directory this will be the same as the baseCtxDn and should begin with “CN=Users”
		f) Click “Save”
		g) Be sure the profile is “Active”, all active servers with “Use As LDAP Sync Source” will be queried for synchronization of data
	2) In the web interface Navigate to the look project -> Authentication Manager -> LDAP Sync
	3) Complete the form, providing values for all of the settings as appropriate for your needs

                - See the tooltips for each field for more details
                - To use the mail reporting feature, create a Tracker or Discussion forum, and input the appropriate address in the 'Mail To' field
        4) Click 'Save'
        5) If Enable Sync is set to 'true'  at the interval specified by the '* Job Cron Interval' values, the corresponding job will run
        6) After the job has run check the following to ensure the synchronization completed properly:

        	1) Optionally review '/opt/collabnet/teamforge/log/app/server.log' for indication of synchronization activity
                2) Review Admin -> User Groups to see if new groups were created
                3) Review Admin -> Users, to see if user status was changed
                4) Review Admin -> Users -> {Username} -> Edit, to see if user settings were updated
                5) Review the Discussion Forum or Tracker (email address such as: tracker1001@teamforge72.com ) specified in the "Mail and Reporting Settings" fields, for detailed reports on synchronization activity



FIXED ISSUES (Test this also)




USER STORIES




SUPPORT

   Support for all Collabnet applications can be found here:

       http://www.open.collab.net/support/

   Also review your support contract and/or any Statements of Work to
   see how applicable support is for this custom extension.

COPYRIGHT

   Copyright (c) 2013, CollabNet
   All Rights Reserved

LICENSE

   CollabNet, Inc.
   http://www.collab.net

AUTHOR

   What is my name and email address again?
