rama
rama

Reputation: 1

passing network credentials through flex4

i want to pass network credentials (username and password) through flex.

i was not able to get appropriate results using

webservice.setcredentials()

webservice.setremotecredentials()

please guide me with examples its urgent

Upvotes: 0

Views: 390

Answers (1)

Jarno Lahtinen
Jarno Lahtinen

Reputation: 1703

Here you use http service call with two parameters.

<mx:HTTPService url="{loginUrl}" id="login" method="POST" >
    <mx:request>
       <username>{tiUsername.text}</username>
       <password>{tiPassword.text}</password>
    </mx:request> 
</mx:HTTPService>

Here you use URLVariables to hold login crendentials:

var credentials:URLVariables = new URLVariables();
credentials.username = tiUsername.text;
credentials.password = tiPassword.text;
var request:URLRequest = new URLRequest();
request.url = "./login";
request.method = URLRequestMethod.POST;
request.data = credentials;
navigateToURL(request);

tiUsername and tiPassword are textInputFields where user enters login credentials.

Upvotes: 1

Related Questions