Windows Authentication using WebOrb and Flex Client

1) First make sure that the security level in IIS (at least for the WebOrb virtual Directory is set to Windows Integrated security)

2) CREATE A C# CLASS with the following function

public string getUsername()
{

System.Security.Principal

.WindowsPrincipal p = System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal;
string strName = p.Identity.Name;
return strName;
}

Flex Client Code Action Script

<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;

//import mx.rpc.remoting.RemoteObject;
import flash.net.registerClassAlias;
import mx.controls.Alert;
import mx.messaging.config.ServerConfig;
private var nc:NetConnection;
private var so:SharedObject;

private function establishConnection():void
{

var ro:RemoteObject = new RemoteObject();
ro.destination = “PANO2″;
ro.addEventListener(ResultEvent.RESULT, dataHandler);
ro.getUsername();

}
private function dataHandler( event:ResultEvent ):void
{
var uname:String = new String();
uname = event.result.toString();
//At this point you have uname as a string. Do what you want with it.
}

]]>

About the Author

Greg

One Response to “Windows Authentication using WebOrb and Flex Client”

  1. Not to worry! Taken care of! Thanks!

Leave a Reply

You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <code> <em> <strong>


Warning: stristr() [function.stristr]: Empty delimiter in /home/thegard5/public_html/gregjessup/wp-content/plugins/wassup/wassup.php on line 2093