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">
   <cfelse>
   <cfset valid="false">
</cfif>
<cfreturn valid>
</cffunction>
</cfcomponent>

--mxml

<?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">

<mx:Script>
      <![CDATA[
            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 {
                Alert.show(evt.type);
                            }
                           
private function validation_result(evt:ResultEvent):void {
                Alert.show(evt.type);
            }



private function button_click():void {
                webService.identifyuser.send();                          
            }

            
      ]]>
</mx:Script>





<mx:WebService id="webService"
            wsdl="http://localhost:8500/flexcfws/validation.cfc?wsdl">
        <mx:operation name="identifyuser" resultFormat="object"
                             
                result="validation_result(event);"
                fault="validation_fault(event);"/>
               
    </mx:WebService>




      <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();"/>
      </mx:Panel>
      
</mx:Application>




faisalmohiAsked:
Who is Participating?
 
_agx_Commented:
@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!
0
 
dgofmanCommented:
@faisalmohi,
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.

or

Good Luck!

????
0
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.