?
Solved

I need Simple NT Authentication in FLEX

Posted on 2011-10-03
3
Medium Priority
?
361 Views
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">
   <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>




0
Comment
Question by:faisalmohi
  • 2
3 Comments
 
LVL 29

Expert Comment

by:dgofman
ID: 36907000
0
 
LVL 52

Accepted Solution

by:
_agx_ earned 2000 total points
ID: 36907199
@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
 
LVL 29

Expert Comment

by:dgofman
ID: 36977851
@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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

864 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