In Flash Remoting MX 2004 the Connection subclass of NetConnection adds an AMF header. Using NetConnection.addHeader. I'm not sure where AMFPHP looks for credentials, but if I had to guess, I'd say the following would work since you subclass NetConnection:


public function setCredentials(username:String, password:String):void {
      addHeader("Credentials", false, {userid: username, password: password});
}

You should also provide a way to clear the credentials since AMF headers are sent on every request.


-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jesús Iglesias
Sent: Thursday, May 18, 2006 10:19 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] AMFPHP credentials, secured services

Hi,
Here you got. What I don't know is how to pass credentials.
Thanks.

private var gateway : RemotingConnection; gateway = new RemotingConnection( "http://domain.com/amfphp/gateway.php"
);
gateway.call( "Service.getMethod", new Responder(onResultGetMethod, onFault));

RemotingConnection.as
---------------------
package {
      import flash.net.NetConnection;
      import flash.net.ObjectEncoding;
      public class RemotingConnection extends NetConnection{
            public function RemotingConnection( sURL:String ){
                  objectEncoding = ObjectEncoding.AMF0;
                  if (sURL) connect( sURL );
            }
            public function AppendToGatewayUrl( s : String ) : void{
            //
            }
      }
}




-----Mensaje original-----
De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] En nombre de Peter Farland Enviado el: jueves, 18 de mayo de 2006 15:55
Para: flexcoders@yahoogroups.com
Asunto: RE: [flexcoders] AMFPHP credentials, secured services


How are you calling your amfphp endpoint?


-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jesús Iglesias
Sent: Thursday, May 18, 2006 7:19 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] AMFPHP credentials, secured services

Hi,

How can I run secured services now on Flex2 through amfphp. I have not found any setCredentials method.

Thanks.



------------------------ Yahoo! Groups Sponsor --------------------~--> Everything you need is one click away.  Make Yahoo! your home page now.
http://us.click.yahoo.com/AHchtC/4FxNAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~->

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links









--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links











--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links









--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to