Examples of AuthenticationTrustResolver


Examples of org.springframework.security.authentication.AuthenticationTrustResolver

        contextToSave.setAuthentication(testToken);
        HttpSessionSecurityContextRepository repo = new HttpSessionSecurityContextRepository();
        MockHttpServletRequest request = new MockHttpServletRequest();
        HttpRequestResponseHolder holder = new HttpRequestResponseHolder(request, new MockHttpServletResponse());
        repo.loadContext(holder);
        AuthenticationTrustResolver trustResolver = mock(AuthenticationTrustResolver.class);
        repo.setTrustResolver(trustResolver);

        repo.saveContext(contextToSave, holder.getRequest(), holder.getResponse());

        verify(trustResolver).isAnonymous(contextToSave.getAuthentication());
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationTrustResolver

                http.setSharedObject(SecurityContextRepository.class, new NullSecurityContextRepository());
            } else {
                HttpSessionSecurityContextRepository httpSecurityRepository = new HttpSessionSecurityContextRepository();
                httpSecurityRepository.setDisableUrlRewriting(!enableSessionUrlRewriting);
                httpSecurityRepository.setAllowSessionCreation(isAllowSessionCreation());
                AuthenticationTrustResolver trustResolver = http.getSharedObject(AuthenticationTrustResolver.class);
                if(trustResolver != null) {
                    httpSecurityRepository.setTrustResolver(trustResolver);
                }
                http.setSharedObject(SecurityContextRepository.class, httpSecurityRepository);
            }
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationTrustResolver

            sessionManagementFilter.setAuthenticationFailureHandler(new SimpleUrlAuthenticationFailureHandler(sessionAuthenticationErrorUrl));
        }
        if(invalidSessionUrl != null) {
            sessionManagementFilter.setInvalidSessionStrategy(getInvalidSessionStrategy());
        }
        AuthenticationTrustResolver trustResolver = http.getSharedObject(AuthenticationTrustResolver.class);
        if(trustResolver != null) {
            sessionManagementFilter.setTrustResolver(trustResolver);
        }
        sessionManagementFilter = postProcess(sessionManagementFilter);
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationTrustResolver

    }

    private SecurityExpressionHandler<FilterInvocation> getExpressionHandler(H http) {
        if(expressionHandler == null) {
            DefaultWebSecurityExpressionHandler defaultHandler = new DefaultWebSecurityExpressionHandler();
            AuthenticationTrustResolver trustResolver = http.getSharedObject(AuthenticationTrustResolver.class);
            if(trustResolver != null) {
                defaultHandler.setTrustResolver(trustResolver);
            }
            expressionHandler = postProcess(defaultHandler);
        }
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationTrustResolver

        assertEquals("/timedOut", response.getRedirectedUrl());
    }

    @Test
    public void customAuthenticationTrustResolver() throws Exception {
        AuthenticationTrustResolver trustResolver= mock(AuthenticationTrustResolver.class);
        SecurityContextRepository repo = mock(SecurityContextRepository.class);
        SessionManagementFilter filter = new SessionManagementFilter(repo);
        filter.setTrustResolver(trustResolver);
        HttpServletRequest request = new MockHttpServletRequest();
        authenticateUser();
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationTrustResolver

    }

    @Test
    public void rememberMeIsCorrectlyDetected() throws Exception {
        SecurityExpressionRoot root = new SecurityExpressionRoot(JOE) {};
        AuthenticationTrustResolver atr = mock(AuthenticationTrustResolver.class);
        root.setTrustResolver(atr);
        when(atr.isRememberMe(JOE)).thenReturn(true);
        assertTrue(root.isRememberMe());
        assertFalse(root.isFullyAuthenticated());
    }
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationTrustResolver

     * @return true/false - false if user interactively logged in.
     */
    public boolean isRememberMe() {
        if (user != null && user.getId() == null) return false; // check for add()
       
        AuthenticationTrustResolver resolver = new AuthenticationTrustResolverImpl();
        SecurityContext ctx = SecurityContextHolder.getContext();

        if (ctx != null) {
            Authentication auth = ctx.getAuthentication();
            return resolver.isRememberMe(auth);
        }
        return false;
    }
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationTrustResolver

    public void logout() {
        // NYI
    }

    public boolean isRememberMe() {
        AuthenticationTrustResolver resolver = new AuthenticationTrustResolverImpl();
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();

        return resolver.isRememberMe(authentication);
    }
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationTrustResolver

    public boolean isRememberMe() {
        if (user != null && user.getId() == null) {
            return false; // check for add()
        }
        AuthenticationTrustResolver resolver = new AuthenticationTrustResolverImpl();
        SecurityContext ctx = SecurityContextHolder.getContext();

        if (ctx != null) {
            Authentication auth = ctx.getAuthentication();
            return resolver.isRememberMe(auth);
        }
        return false;
    }
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationTrustResolver

     * @return true/false - false if user interactively logged in.
     */
    public boolean isRememberMe() {
        if (user != null && user.getId() == null) return false; // check for add()
       
        AuthenticationTrustResolver resolver = new AuthenticationTrustResolverImpl();
        SecurityContext ctx = SecurityContextHolder.getContext();

        if (ctx != null) {
            Authentication auth = ctx.getAuthentication();
            return resolver.isRememberMe(auth);
        }
        return false;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.