I need Simple NT Authentication in FLEX

Posted on 2011-10-03
Last Modified: 2012-05-12
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="" 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.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();"/>

Question by:faisalmohi
    LVL 29

    Expert Comment

    LVL 51

    Accepted Solution

    @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!
    LVL 29

    Expert Comment

    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!


    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
    Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math ( While this method is not o…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now