Announcement Announcement Module
No announcement yet.
Problems with AuthenticationCredentialsNotFoundException and Page Refresh Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems with AuthenticationCredentialsNotFoundException and Page Refresh

    I'm having some problems with AuthenticationCredentialsNotFoundException.

    My authentication works the following way:

    When my initial page (index.mxml) is loaded, I check a variable I keep in a singleton ActionScript class, a model locator. This variable tells me if someone is authenticated. If this is false, I display a login popup to the user. The user enters his credentials, submits the popup and the authentication is done.

    Problem 1:

    Sometimes, not always, whenever I select a function from my application in the menu, spring security is called to check the user's authorities. Sometimes, when it's doing this, the SecurityContextHolder is null, and I get the exception mentioned. I'm using MethodSecurityInterceptor for checking permissions here. I've already tried setting the context to MODE_INHERITABLETHREADLOCAL, but I keep getting this problem nonetheless. The only context which works, but I shouldn't use, because this isn't a standalone application, is MODE_GLOBAL...I never got the exception using this. Any idea why sometimes I get this exception, and other times I do not?

    Problem 2:

    Whenever I refresh the page, hitting the F5 button, the HttpSession associated to the current context is invalidated, and the authentication is cleared. However, I also do not understand why, whenever I login again, the application doesn't seem to call the login service again, I just enter the credentials, hit submit and the initial page is displayed normally. But, since I never got to be properly authenticated, I keep getting errors as the one above. Anyone knows why Flex doesn't call the login service again? I'm pretty sure it's not getting called, because I'm not getting interrupted in the breakpoints I'm placing in the login service, and there's no query printed in the console indicating the authentication is being done.