Credentials and retargetting, desktop and ipad

We have created a small application that users log into with a username and password. The uname/pwd is validated and the user can then swap to various apps via retargetting.

The host application is based on an autologin and known user/pwd. The swithuser api call is used to switch to the desired user and the target application is launched.

All this works well on the desktop but on the ipad it appears as though the autologin credentials are being passed through, not the credentials of the user.

Here is the code for the user switching we are using in the host application.

strUsername = event.source.parent.getComponent('UsernameField').text; 
strPassword = event.source.parent.getComponent('PasswordField').text
if strUsername != "":
	if strPassword != "":
		if system.db.runScalarPrepQuery("SELECT 1 FROM scada_users WHERE username = ?", [strUsername]) != 0:
			success = system.security.switchUser(strUsername,strPassword)
			if not success:
				event.source.parent.getComponent("PasswordField").requestFocusInWindow()
				system.gui.messageBox("Incorrect username or password.")
			else:
				system.nav.swapWindow(event, "AppSelector")
				system.nav.closeWindow('Login')
		else:
			event.source.parent.getComponent("UsernameField").requestFocusInWindow()
			system.gui.messageBox("Invalid username.")
	else:
		event.source.parent.getComponent("PasswordField").requestFocusInWindow()
		system.gui.messageBox("Enter password.")
else:
	event.source.parent.getComponent("UsernameField").requestFocusInWindow()
	system.gui.messageBox("Enter username.")

Again, this all works on the desktop, not on the IPad.

Any ideas would be appreciated?