Examples Of Using Simple ICA Scripting to Log In

Added by Citrix CDN , last edited by Citrix CDN on Nov 05, 2007  (view change)
Tags: 

Description

The following are scripting examples to log in using an ICA file.

Any ICA file can be used in place of the myserver.ica file used in the examples below.  Attached is simple ICA file for reference.   

Script Version

1.0   

Download

Supported Version

ICA Client for Windows 7.0 and later  

How to Use

 Copy and paste the script examples below in Notepad and save them as HTML files.

Open a Web browser and view the files.  

Code Snippet

 An example of using simple scripting to log in using ActiveX: 

<HTML>
<HEAD>
<TITLE>Login example for ActiveX</TITLE>
<script language="javascript">
<!--
function Login(form)
{
icaobj.SetProp("Username",form.username.value)
icaobj.SetProp("Password",form.password.value)
icaobj.Connect()
}
-->
</script>
</HEAD>
<BODY>
<h1>Login example for ActiveX</h1>
<p>
<center>
<object id=icaobj classid="clsid:238f6f83-b8b4-11cf-8771-00a024541ee3" width=640 height=480>

<param name="ICAFile" value="{color}{color:#0000ff}{_}myserver.ica_">

</object>

<form name=loginform>
Username:<input type=text name="username"><br>
Password:<input type=password name="password"><br>
<input type=button value="Login" OnClick="Login(this.form)">
</form>
</center>

</BODY>
</HTML>

An example of using simple scripting to log in using Netscape: 

<HTML>
<HEAD>
<TITLE>Login example for Netscape Plugin</TITLE>
<script language="javascript">
<!--
function Login(form)
{
document.icaobj.SetProp("Username",form.username.value)
document.icaobj.SetProp("Password",form.password.value)
document.icaobj.SetProp("PasswordType", "0")
document.icaobj.SetProp("Domain",form.domain.value)
document.icaobj.Connect()
}
-->
</script>
</HEAD>
<BODY>
<h1>Login example for Netscape Plugin</h1>

<p>Login with Username, password, and domain.<p>

<center>
<embed width=640 height=480 src=_myserver.ica_ type=application/x-ica name=icaobj>

<form name=loginform>
Username:<input type=text name="username"><br>
Password:<input type=password name="password"><br>
Domain:<input type=text name="domain"><br>
<input type=button value="Login" OnClick="Login(this.form)">
</form>
</center>

</BODY>
</HTML>

  

Disclaimer

These software applications are provided to you as is with no representations, warranties or conditions of any kind.  You may use and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the software application may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the software application fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the software application.  In no event should the code be used to support of ultra-hazardous activities, including but not limited to life support or blasting activities.  NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SOFTWARE APPLICATION, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.  You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the code.