Spring Security
  1. Spring Security
  2. SEC-1210

RememberMe filter misses UserDetailsService in default <http /> tag config when it is declared in parent app context

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.5
    • Fix Version/s: 3.0.0 M2
    • Component/s: Namespace
    • Labels:
      None

      Description

      Suppose the following scenarion: you have an UserDetailsService implementation declared in a config file loaded by a ContextLoaderListener. You declare an <http /> namespace element in the config file for the DispatcherServlet. When you try to launch this webapp this causes an exception thrown by AbstractRememberMeService claiming no UserDetailsService was found. SO somehow the namespace avoids to find the bean in a possibly available parent ApplicationContext.

      A workaround to this behaviour is to explicitly define a <remember-me /> element and let user-service-ref explicitly point to the bean to be used.

        Activity

        Hide
        Luke Taylor added a comment -

        I've modified UserDetailsServiceInjectionPostProcessor to check ancestor bean factories for a UserDetailsService if one isn't found in the current bean factory.

        Show
        Luke Taylor added a comment - I've modified UserDetailsServiceInjectionPostProcessor to check ancestor bean factories for a UserDetailsService if one isn't found in the current bean factory.

          People

          • Assignee:
            Luke Taylor
            Reporter:
            Oliver Gierke
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: