I need Simple NT Authentication in FLEX

Dear Experts,

I'm just a new baby in flex programming. i need simple authentication using flex webservice using coldfusion cfc. if authenticated alert says yes not as no

<cfcomponent hint="All Validation">
<cffunction name="identifyuser"
 hint="accepts username" returntype="boolean" access="remote">
 <cfargument name="username" type="string" required="yes">
 <cfargument name="password" type="string" required="yes">
 <cfNTauthenticate username="#username#"
password="#password#" domain="kfh" result="authResult" listGroups = "yes"     throwOnError = "no">  
<cfif authResult.auth eq 'YES'>
  <cfset valid="true">
   <cfset valid="false">
<cfreturn valid>


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
            backgroundGradientColors="[#808080, #ffffff]" backgroundImage="assets/top-bg-x.jpg" top="5" right="5" bottom="5" left="5" styleName="plain">

            import mx.controls.Alert;
            import mx.rpc.events.ResultEvent;
            import mx.rpc.events.FaultEvent;
            import mx.utils.ObjectUtil;
private function validation_fault(evt:FaultEvent):void {
private function validation_result(evt:ResultEvent):void {

private function button_click():void {


<mx:WebService id="webService"
        <mx:operation name="identifyuser" resultFormat="object"

      <mx:Panel width="250" height="200" layout="absolute" horizontalCenter="-0" verticalCenter="-2" id="login" title="Login">
            <mx:TextInput x="35" y="36" id="username" maxChars="20" displayAsPassword="false" editable="true" enabled="true"/>
            <mx:TextInput x="35" y="79" id="password" maxChars="20" displayAsPassword="true" editable="true" enabled="true"/>
            <mx:Label x="35" y="16" text="User Name"/>
            <mx:Label x="35" y="59" text="Password"/>
            <mx:Button x="82" y="109" label="Login" id="Submit" labelPlacement="right" click="button_click();"/>

Who is Participating?
@faisalmohi - I'm not a flash expert. But it'd help  those that are if you explained what the code is doing wrong.  

Also, be sure to test your CFC in CF first. No point calling it from Flex unless it actually works as expected in CF.

Good Luck!
Is very weird you accept an answer #36907199

What exactly helped to you?

Also, be sure to test your CFC in CF first. No point calling it from Flex unless it actually works as expected in CF.


Good Luck!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.