Results 1 to 2 of 2

Thread: My simple AuthenticationSuccessHandler disrupts login flow

  1. #1
    Join Date
    Sep 2009
    Posts
    126

    Default My simple AuthenticationSuccessHandler disrupts login flow

    Hello,

    I've just written a small implementation of AuthenticationSuccessHandler to interrogate the principal of the Authentication object and put something in the session:
    Code:
        public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
            String timeZoneId = null;
            UserDetailsAgent uda = (UserDetailsAgent) authentication.getPrincipal();
                timeZoneId = uda.getAgent().getTimezoneId();
            // Store the time zone id in the session
            request.getSession().setAttribute(SESSION_ATTR_NAME_TIME_ZONE_ID,
                    timeZoneId != null ? timeZoneId : defaultTimeZoneId);
        }
    Now after logging in, I don't get redirected/forwarded anywhere. I'm left at http://localhost:8080/myapp/j_spring_security_check. How can I include my logic without disrupting what normally happens?

    Thanks,

    PUK

  2. #2
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    It's up to you to control the flow from the AuthenticationSuccessHandler. That's one of the main reasons for introducing the strategy. The number of different configuration options was getting out of hand. There's a section in the manual which describes this.
    Spring - by Pivotal
    twitter @tekul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •