Announcement Announcement Module
Collapse
No announcement yet.
getAuthentication returns null sometimes Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • getAuthentication returns null sometimes

    Hi,

    I have strange problem with Sping BlazeDS integration Version 1.0.0.M2 and Spring security. I am using Tomcat 5.5.27.

    Most of the time everything works fine but sometimes when calling SecurityContextHolder.getContext().getAuthenticati on().getPrincipal() fails because getAuthentication returns null. After few seconds exactly the same code in same method may work fine(same button clicked on Flex client, same parameters). There's not any pattern to reproduce this every time Maybe I have some problem in session handling? I followed Spring BlazeDS Integration Reference Guide for configuring security.

    Any ideas?

  • #2
    Fixed

    Hi,

    I found the reason. I didn't have springSecurityFilterChain configured in my web.xml. Seems to be working now as expected.

    Comment


    • #3
      Having the same problem

      Hi there,

      I may be having the same problem you were having, but I have my springSecurityFilterChain configured properly, as this:

      <filter>
      <filter-name>springSecurityFilterChain</filter-name>
      <filter-class>
      org.springframework.web.filter.DelegatingFilterPro xy
      </filter-class>
      </filter>

      <filter-mapping>
      <filter-name>springSecurityFilterChain</filter-name>
      <url-pattern>/*</url-pattern>
      </filter-mapping>

      Were you also getting a AuthenticationCredentialsNotFoundException? I'm struggling with this, I can't get the SecurityContext consistently after getting the user authenticated. Sometimes it works, but most times the Authentication is null and I end up getting the exception above. Could really use some help with this

      Comment


      • #4
        This could potentially be related to a couple of the bugs we fixed in RC1. Try upgrading and see if you have the same issue.

        Comment

        Working...
        X