Package org.springframework.security.web.savedrequest

Examples of org.springframework.security.web.savedrequest.RequestCache


                }
                http.setSharedObject(SecurityContextRepository.class, httpSecurityRepository);
            }
        }

        RequestCache requestCache = http.getSharedObject(RequestCache.class);
        if(requestCache == null) {
            if(stateless) {
                http.setSharedObject(RequestCache.class, new NullRequestCache());
            }
        }
View Full Code Here


        http.setSharedObject(RequestCache.class, getRequestCache(http));
    }

    @Override
    public void configure(H http) throws Exception {
        RequestCache requestCache = getRequestCache(http);
        RequestCacheAwareFilter requestCacheFilter = new RequestCacheAwareFilter(requestCache);
        requestCacheFilter = postProcess(requestCacheFilter);
        http.addFilter(requestCacheFilter);
    }
View Full Code Here

     *
     * @param http the {@link HttpSecurity} to attempt to fined the shared object
     * @return the {@link RequestCache} to use
     */
    private RequestCache getRequestCache(H http) {
        RequestCache result = http.getSharedObject(RequestCache.class);
        if(result != null) {
            return result;
        }
        HttpSessionRequestCache defaultCache = new HttpSessionRequestCache();
        defaultCache.setRequestMatcher(createDefaultSavedRequestMatcher(http));
View Full Code Here

     *
     * @param http the {@link HttpSecurity} to attempt to fined the shared object
     * @return the {@link RequestCache} to use
     */
    private RequestCache getRequestCache(H http) {
        RequestCache result = http.getSharedObject(RequestCache.class);
        if(result != null) {
            return result;
        }
        return new HttpSessionRequestCache();
    }
View Full Code Here

    @Test
    public void onAuthenticationSuccessHasSavedRequest() throws Exception {
        String redirectUrl = "http://localhost/appcontext/page";
        RedirectStrategy redirectStrategy = mock(RedirectStrategy.class);
        RequestCache requestCache = mock(RequestCache.class);
        SavedRequest savedRequest = mock(SavedRequest.class);
        MockHttpServletRequest request = new MockHttpServletRequest();
        MockHttpServletResponse response = new MockHttpServletResponse();
        when(savedRequest.getRedirectUrl()).thenReturn(redirectUrl);
        when(requestCache.getRequest(request, response)).thenReturn(savedRequest);

        SavedRequestAwareAuthenticationSuccessHandler handler = new SavedRequestAwareAuthenticationSuccessHandler();
        handler.setRequestCache(requestCache);
        handler.setRedirectStrategy(redirectStrategy);
        handler.onAuthenticationSuccess(request, response, mock(Authentication.class));
View Full Code Here

                httpSecurityRepository.setAllowSessionCreation(isAllowSessionCreation());
                builder.setSharedObject(SecurityContextRepository.class, httpSecurityRepository);
            }
        }

        RequestCache requestCache = builder.getSharedObject(RequestCache.class);
        if(requestCache == null) {
            if(stateless) {
                builder.setSharedObject(RequestCache.class, new NullRequestCache());
            }
        }
View Full Code Here

        return this;
    }

    @Override
    public void configure(H http) throws Exception {
        RequestCache requestCache = getRequestCache(http);
        RequestCacheAwareFilter requestCacheFilter = new RequestCacheAwareFilter(requestCache);
        requestCacheFilter = postProcess(requestCacheFilter);
        http.addFilter(requestCacheFilter);
    }
View Full Code Here

     *
     * @param http the {@link HttpSecurity} to attempt to fined the shared object
     * @return the {@link RequestCache} to use
     */
    private RequestCache getRequestCache(H http) {
        RequestCache result = http.getSharedObject(RequestCache.class);
        if(result != null) {
            return result;
        }
        return new HttpSessionRequestCache();
    }
View Full Code Here

     *
     * @param http the {@link HttpSecurity} to attempt to fined the shared object
     * @return the {@link RequestCache} to use
     */
    private RequestCache getRequestCache(H http) {
        RequestCache result = http.getSharedObject(RequestCache.class);
        if(result != null) {
            return result;
        }
        return new HttpSessionRequestCache();
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.web.savedrequest.RequestCache

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.