Package org.springframework.security.web

Examples of org.springframework.security.web.DefaultRedirectStrategy


      OpenIDAuthenticationToken token = (OpenIDAuthenticationToken)exception.getAuthentication();
      String url = token.getIdentityUrl();
      User user = createTemporaryUser(token, url);
      request.getSession(true).setAttribute(ModelKeys.NEW_USER, user);

      DefaultRedirectStrategy redirectStrategy = new DefaultRedirectStrategy();
      log.info("Redirecting to new user account creation page");
      super.setRedirectStrategy(redirectStrategy);
      redirectStrategy.sendRedirect(request, response, "/"+ViewNames.CREATE_ACCOUNT_PAGE);
      return;
    } else {
      super.onAuthenticationFailure(request, response, exception);
    }
  }
View Full Code Here


        MockHttpServletResponse response = new MockHttpServletResponse();

        // Setup our test fixture and registry to want this session to be expired
        ConcurrentSessionFilter filter = new ConcurrentSessionFilter();
        filter.setRedirectStrategy(new DefaultRedirectStrategy());
        filter.setLogoutHandlers(new LogoutHandler[] {new SecurityContextLogoutHandler()});

        SessionRegistry registry = new SessionRegistryImpl();
        registry.registerNewSession(session.getId(), "principal");
        registry.getSessionInformation(session.getId()).expireNow();
View Full Code Here

        SwitchUserFilter filter = new SwitchUserFilter();
        filter.setSwitchUserUrl("/j_spring_security_switch_user");
        SimpleUrlAuthenticationSuccessHandler switchSuccessHandler =
            new SimpleUrlAuthenticationSuccessHandler("/someOtherUrl");
        DefaultRedirectStrategy contextRelativeRedirector = new DefaultRedirectStrategy();
        contextRelativeRedirector.setContextRelative(true);
        switchSuccessHandler.setRedirectStrategy(contextRelativeRedirector);
        filter.setSuccessHandler(switchSuccessHandler);
        filter.setUserDetailsService(new MockUserDetailsService());

        FilterChain chain = mock(FilterChain.class);
View Full Code Here

      OpenIDAuthenticationToken token = (OpenIDAuthenticationToken)exception.getAuthentication();
      String url = token.getIdentityUrl();
      User user = createTemporaryUser(token, url);
      request.getSession(true).setAttribute(ModelKeys.NEW_USER, user);

      DefaultRedirectStrategy redirectStrategy = new DefaultRedirectStrategy();
      log.info("Redirecting to new user account creation page");
      super.setRedirectStrategy(redirectStrategy);
      redirectStrategy.sendRedirect(request, response, "/"+ViewNames.CREATE_ACCOUNT_PAGE);
      return;
    } else {
      super.onAuthenticationFailure(request, response, exception);
    }
  }
View Full Code Here

    setRedirectStrategy(new org.springframework.security.web.DefaultRedirectStrategy());
  }

  public UserAuthorizationSuccessfulAuthenticationHandler(String s) {
    super(s);
    setRedirectStrategy(new DefaultRedirectStrategy());
  }
View Full Code Here

            super.onAuthenticationFailure(request, response, e);
        }
    }

    private void redirectToOpenIdRegistrationUrl(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException {
        DefaultRedirectStrategy redirectStrategy = new DefaultRedirectStrategy();
        addOpenIdAttributesToSession(request, getOpenIdAuthenticationToken((OpenIDUserNotFoundException) exception));
        redirectStrategy.sendRedirect(request, response, openIdRegistrationUrl);
    }
View Full Code Here

      OpenIDAuthenticationToken token = (OpenIDAuthenticationToken)exception.getAuthentication();
      String url = token.getIdentityUrl();
      User user = createTemporaryUser(token, url);
      request.getSession(true).setAttribute(ModelKeys.NEW_USER, user);

      DefaultRedirectStrategy redirectStrategy = new DefaultRedirectStrategy();
      log.info("Redirecting to new user account creation page");
      super.setRedirectStrategy(redirectStrategy);
      redirectStrategy.sendRedirect(request, response, "/"+ViewNames.CREATE_ACCOUNT_PAGE);
      return;
    } else {
      super.onAuthenticationFailure(request, response, exception);
    }
  }
View Full Code Here

  /**
   * @return the redirectStrategy
   */
  public DefaultRedirectStrategy getRedirectStrategy() {
    if (redirectStrategy == null) {
      redirectStrategy = new DefaultRedirectStrategy();
    }
    return redirectStrategy;
  }
View Full Code Here

TOP

Related Classes of org.springframework.security.web.DefaultRedirectStrategy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.