Try printing/alerting the result of the HTTPService - function
auth_check()
Does it return true as expected???
Manu Juyal wrote:
Haven't had much in solving this problem... would appreciated if
anybody can help..
On 7/22/05, Manu Juyal <[EMAIL PROTECTED]> wrote:
> here is code snippet again
>
> I am using HTTPService to do authentication and also to retrieve
the data.
> Following is the part of the code..
>
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
> xmlns="*" height="661" autoLayout="false" marginTop="0"
marginLeft="0"
> marginRight="0" marginBottom="0">
>
> <mx:Script>
> <![CDATA[
> //Call getuser, which calls webauth verify to check the current
user
> function auth() {
> getuser.send({callap:mx.core.Application.application._url, logout:
> "http://xxx.xxx"});
> }
>
> function auth_check() {
> //if the current user is not authenticated by webauth status
will equal fail
> if (getuser.result.auth.status == "fail") {
> //you should now redirect the user to the login page
> getURL(getuser.result.auth.redirect, "_self");
> }
> else{
> getData();
> }
> }
>
> function getData(){
> var myID = getuser.result.auth.asurite;
> lookup.send({myid: myID, user: "xxx", passwd: "xxxxx"});
> popCustomerForm_MyID();
> }
>
> function popCustomerForm_MyID(customerData){
> // Populate the fields in customerpanel
> customerinfostack.selectedChild = customerpanel;
> custfname.text = customerData.values.givenname;
> custlname.text = customerData.values.sn;
> custemail.text = customerData.values.mail;
> custphone.text = customerData.values.phonenumber;
> custdept.text = customerData.values.college;
> custcollege.text = customerData.values.department;
> contfname.text = customerData.values.givenname;
> contlname.text = customerData.values.sn;
> contemail.text = customerData.values.mail;
> contphone.text = customerData.values.phonenumber;
> }
> ]]>
> </mx:Script>
>
> <mx:HTTPService id="getuser" method="POST"
> url=""http://flex.xx.xxx.xxx/lxxx/lxxxx.php">http://flex.xx.xxx.xxx/lxxx/lxxxx.php"
useProxy="false"
> result="auth_check()"/>
>
> <mx:HTTPService id="lookup" url=""http://xxx.xx.xxx.xxx/lxxx/lxxxx.php">http://xxx.xx.xxx.xxx/lxxx/lxxxx.php"
> fault="faultHandler(event.fault.faultstring,
event.fault.faultcode)"
> result="popCustomerForm_MyID(lookup.result)"
> method="POST" showBusyCursor="true" useProxy="false" />
>
> <mx:ViewStack id="customerinfostack" visible="true"
selectedIndex="0"
> width="884" height="559">
> <mx:Panel width="865" title="Login Information"
id="loginpanel" >
> <mx:Button label="login" click="auth()"/>
> </mx:Panel>
>
> <mx:Panel title="Customer information" id="customerpanel"
width="714"
> height="581" verticalAlign="middle" horizontalAlign="center">
> ---This panel has form that needs to be populated
> </mx:Panel>
>
> </mx:ViewStack >
> </mx:Application>
>
>
>
>
>
>
>
>
> On 7/22/05, Manu Juyal <[EMAIL PROTECTED]> wrote:
> > adding to my last email..
> > following is the flow of the application
> >
> > The application starts with "loginpanel" view in the
viewstack... goes
> > to authentication page and after successful authentication
should come
> > back and display "customerpanel" view with all information
populated.
> > However, it is not coming back to "customerpanel" rather
displaying
> > "loginpanel" again...
> >
> >
> >
> > On 7/22/05, Manu Juyal <[EMAIL PROTECTED]> wrote:
> > > I tried moving the line and also providing conditional
statements but
> > > problem remains there
> > >
> > > it is showing loginpanel of the viewstack again after
the login is
> > > successful. I guess when the application starts it
displays the first
> > > view in the stack. Does that mean the application is
starting again
> > > after authentication..
> > >
> > > I am at loss to solve this problem.. :(
> > >
> > >
> > >
> > >
> > > On 7/22/05, Sreejith Unnikrishnan
<[EMAIL PROTECTED]> wrote:
> > > > Didnt see that u had posted the code as well ...
> > > >
> > > > All you would need to do is move this line:
> > > > customerinfostack.selectedChild = customerpanel;
> > > >
> > > > from
> > > > function popCustomerForm_MyID(customerData)
> > > >
> > > > to
> > > > function getData()
> > > >
> > > >
> > > > Sree
> > > >
> > > >
> > > > Manu Juyal wrote:
> > > >
> > > > > I am using HTTPService to do authentication
and also to retrieve the
> > > > > data.
> > > > > Following is the part of the code..
> > > > >
> > > > >
> > > > > <?xml version="1.0" encoding="utf-8"?>
> > > > > <mx:Application
> > > > xmlns:mx="http://www.macromedia.com/2003/mxml"
> > > > > xmlns="*" height="661" autoLayout="false"
marginTop="0" marginLeft="0"
> > > > > marginRight="0" marginBottom="0">
> > > > >
> > > > > <mx:Script>
> > > > > <![CDATA[
> > > > > //Call getuser, which calls webauth verify to
check the current user
> > > > > function auth() {
> > > > >
> > > >
getuser.send({callap:mx.core.Application.application._url,
> > > > logout:
> > > > > "http://xxx.xxx"});
> > > > > }
> > > > >
> > > > > function auth_check() {
> > > > > //if the current user is not authenticated
by webauth status will
> > > > > equal fail
> > > > > if (getuser.result.auth.status == "fail") {
> > > > > //you should now redirect the user to
the login page
> > > > > getURL(getuser.result.auth.redirect,
"_self");
> > > > > }
> > > > > else{
> > > > > getData();
> > > > > }
> > > > > }
> > > > >
> > > > > function getData(){
> > > > > var myID = getuser.result.auth.asurite;
> > > > > lookup.send({myid: myID, user: "xxx",
passwd: "xxxxx"});
> > > > > popCustomerForm_MyID();
> > > > > }
> > > > >
> > > > > function popCustomerForm_MyID(customerData){
> > > > > // Populate the fields in customerpanel
> > > > > customerinfostack.selectedChild =
customerpanel;
> > > > > custfname.text =
customerData.values.givenname;
> > > > > custlname.text = customerData.values.sn;
> > > > > custemail.text = customerData.values.mail;
> > > > > custphone.text =
customerData.values.phonenumber;
> > > > > custdept.text =
customerData.values.college;
> > > > > custcollege.text =
customerData.values.department;
> > > > > contfname.text =
customerData.values.givenname;
> > > > > contlname.text = customerData.values.sn;
> > > > > contemail.text = customerData.values.mail;
> > > > > contphone.text =
customerData.values.phonenumber;
> > > > > }
> > > > > ]]>
> > > > > </mx:Script>
> > > > >
> > > > > <mx:HTTPService id="getuser" method="POST"
> > > > > url=""http://flex.xx.xxx.xxx/lxxx/lxxxx.php">http://flex.xx.xxx.xxx/lxxx/lxxxx.php"
> > > > useProxy="false"
> > > > > result="auth_check()"/>
> > > > >
> > > > > <mx:HTTPService id="lookup"
> > > > url=""http://xxx.xx.xxx.xxx/lxxx/lxxxx.php">http://xxx.xx.xxx.xxx/lxxx/lxxxx.php"
> > > > > fault="faultHandler(event.fault.faultstring,
event.fault.faultcode)"
> > > > > result="popCustomerForm(lookup.result)"
> > > > > method="POST" showBusyCursor="true"
useProxy="false" />
> > > > >
> > > > > <mx:ViewStack id="customerinfostack"
visible="true" selectedIndex="0"
> > > > > width="884" height="559">
> > > > > <mx:Panel width="865" title="Login
Information" id="loginpanel" >
> > > > > <mx:Button label="login"
click="auth()"/>
> > > > > </mx:Panel>
> > > > >
> > > > > <mx:Panel title="Customer information"
id="customerpanel" width="714"
> > > > > height="581" verticalAlign="middle"
horizontalAlign="center">
> > > > > ---This panel has form that needs to be
populated
> > > > > </mx:Panel>
> > > > >
> > > > > </mx:ViewStack >
> > > > > </mx:Application>
> > > > >
> > > > > On 7/21/05, Matt Chotin
<[EMAIL PROTECTED]> wrote:
> > > > > >
> > > > > >
> > > > > > How are you doing the authentication?
Are you using getURL to
> > > > > navigate the
> > > > > > browser? Or are you using an HTTPService
to retrieve the data and using
> > > > > > basic authentication? I'm not sure how
your app is set up here.
> > > > > >
> > > > > >
> > > > > >
> > > > > > Matt
> > > > > >
> > > > > >
> > > > > > ________________________________
> > > > > >
> > > > > >
> > > > > > From: [email protected]
[mailto:[email protected]] On
> > > > > > Behalf Of juyalmanu
> > > > > > Sent: Thursday, July 21, 2005 4:43 PM
> > > > > > To: [email protected]
> > > > > > Subject: [flexcoders] problem in using
web authentication using
> > > > > different
> > > > > > website.
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Dear All,
> > > > > > I am havig problem with web
authentication service along with flex.
> > > > > > The idea is very simple.
> > > > > >
> > > > > > 1. I start a flex application (I am using
viewstack), the first view
> > > > > > in the stach appear with two buttons, one
for members and one for
> > > > > > guest.
> > > > > >
> > > > > > 2. if I am a member, I click a log in
button and it takes me to a
> > > > > > URL where I will authenticate myself (It
works fine).
> > > > > >
> > > > > > 3. Once I authenticate myself, I should
be able to go to the next
> > > > > > view in the stack, where all my
information will retrieved from the
> > > > > > database and all textboxes will be
populated.
> > > > > >
> > > > > > (I am able to authenticate and able to
retrieve the information but
> > > > > > it happens only if I set the call
authentication function on
> > > > > > application's initialize function. In
that case I don't need first
> > > > > > view in the stack (i.e. the view with two
buttons). I'll
> > > > > > automatically go to the web
authentication URL upon the start of the
> > > > > > application. ButI do need the first view).
> > > > > >
> > > > > > In my opinion what happening is that
after completing the
> > > > > > authentication (after coming back from
web authentication URL), the
> > > > > > application is again starting with first
view. However I want it to
> > > > > > start with the second view with the
populated text boxes.
> > > > > >
> > > > > > can anyone give me some idea please.
> > > > > >
> > > > > > --Manu
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > 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
> > > > > >
> > > > > > Visit your group "flexcoders" on the web.
> > > > > >
> > > > > > To unsubscribe from this group, send an
email to:
> > > > > > [EMAIL PROTECTED]
> > > > > >
> > > > > > Your use of Yahoo! Groups is subject to
the Yahoo! Terms of Service.
> > > > > > To unsubscribe from this group, send an
email to:
> > > > > > [EMAIL PROTECTED]
> > > > > >
> > > > > > Your use of Yahoo! Groups is subject to
the Yahoo! Terms of Service.
> > > > > > Your use of Yahoo! Groups is subject to
the Yahoo! Terms of Service.
> > > > > > ________________________________
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > 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
> > > > >
> > > > > * Visit your group "flexcoders
> > > > > <http://groups.yahoo.com/group/flexcoders>"
on the
> > > > web.
> > > > >
> > > > > * To unsubscribe from this group, send an
email to:
> > > > > [EMAIL PROTECTED]
> > > > >
> > > >
<mailto:[EMAIL PROTECTED]>
> > > > >
> > > > > * Your use of Yahoo! Groups is subject to
the Yahoo! Terms of
> > > > > Service <http://docs.yahoo.com/info/terms/>.
> > > > >
> > > > >
> > > > >
> > > >
------------------------------------------------------------------------
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > 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
> > > > Computer software testing Macromedia flex
Development
> > > > Software developer
> > > > ________________________________
> > > > YAHOO! GROUPS LINKS
> > > >
> > > > Visit your group "flexcoders" on the web.
> > > >
> > > > To unsubscribe from this group, send an email to:
> > > > [EMAIL PROTECTED]
> > > >
> > > > Your use of Yahoo! Groups is subject to the Yahoo!
Terms of Service.
> > > > To unsubscribe from this group, send an email to:
> > > > [EMAIL PROTECTED]
> > > >
> > > > Your use of Yahoo! Groups is subject to the Yahoo!
Terms of Service.
> > > > Your use of Yahoo! Groups is subject to the Yahoo!
Terms of Service.
> > > > ________________________________
> > > >
> > >
> >
>
--
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
|