Expand my Community achievements bar.

External Authentication Issue

Avatar

Level 1

Hi,

I am externally authenticating my application. I fetch the authToken and use it in the flex application as follows;

  function init():void

                              {

                                        authToken="exx=eDpVc2VyTmFtZTo6amF5ZXNoc2lkaHdhbmk6VXNlcklkOm5ld3NlcnZlcjoxMDA6M2UyYTYwYjg3ZjllMmQ4ZGRiMjQyYmVjNzE3NzJiOGM0MGIzNzI1Mw=="; //This is a valid code, hand wired.

                                        CursorManager.setBusyCursor();

                              }

protected function auth_authenticationFailureHandler(event:AuthenticationEvent):void

                              {

                                        Alert.show(event.toString());// + auth.authenticationURL);

                              }

 

                              protected function auth_authenticationSuccessHandler(event:AuthenticationEvent):void

                              {

                                        Alert.show(event.toString());

                              }

<fx:Declarations>

 

                    <rtc:AdobeHSAuthenticator id="auth" authenticationKey="{authToken}" authenticationFailure="auth_authenticationFailureHandler(event)">

 

                    </rtc:AdobeHSAuthenticator>

          </fx:Declarations>

 

          <rtc:ConnectSessionContainer id="cSession" x="329" y="265" authenticator="{auth}"

                                                                                 roomURL="https://collaboration.adobelivecycle.com/username/roomname">

 

                              <rtc:SharedWhiteBoard id="sharedWhiteboard" width="100%" height="100%" creationComplete="sharedWhiteboard_creationCompleteHandler(event)">

 

                              </rtc:SharedWhiteBoard>

 

          </rtc:ConnectSessionContainer>

Now, when the page loads, it continuously loops call to auth_authenticationSuccessHandle, so I get alert messages (in the function) continuosly. The app is not initialized.

However, if I replace the {authToken} value in <rtc:AdobeHSAuthenticator> by the actual authentication token, it goes in the success function only once and the app is initialized normally. Can you please help me figure out what wrong I am doing.

Thanks.

1 Reply

Avatar

Employee

I would suggest you set autoLogin="false" on rtc:ConnectSessionContainer and call cSession.login() when you are ready (you got the token and have everything set up).

I suspect the automatic login is getting executed before the AdobeHSAuthenticator has been correctly setup.