0 Replies Latest reply on Nov 29, 2010 1:03 PM by Hor4na

    Security context is after authentication sometimes still empty

    Hor4na

      Hello,

       

      I have so something in Flex:
      <s:RemoteObject id="dest1" destination="some_d"/>
      <s:RemoteObject id="dest2" destination="some_o_d"/>
      ...
      var channel:AMFChannel = new AMFChannel("my-amf", "url");
      var channelSet:ChannelSet = new ChannelSet();
      channelSet.addChannel(channel);
      dest1.channelSet = channelSet;
      var token:AsyncToken = dest1.channelSet.login("usr", "passwd");
      token.addResponder(new AsyncResponder(resultHandler, null));
      ....
      function resultHandler(event:ResultEvent,token : AsyncToken):void {
      dest2.call_method();
      }

       

      And in Java:
      public void call_method() {
      Authentication auth = SecurityContextHolder.getContext().getAuthenticati on();
      }

       

      Sometimes (1 of 3 runs) happens, that auth object is null. What am i doing wrong?

       

      User and his roles are writen in spring.xml. I see from logs, that Spring use DaoAuthenticationProvider.

       

      tHx,
      pH.

       


      PS: Using Spring BlazeDS 1.0.3 on Tomcat 6.