Examples of AuthenticationTrustResolverImpl


Examples of org.springframework.security.authentication.AuthenticationTrustResolverImpl

                new AnonymousAuthenticationToken("ignored", "ignored", AuthorityUtils.createAuthorityList("IGNORED")));

        // Test
        ExceptionTranslationFilter filter = new ExceptionTranslationFilter();
        filter.setAuthenticationEntryPoint(mockEntryPoint);
        filter.setAuthenticationTrustResolver(new AuthenticationTrustResolverImpl());
        assertNotNull(filter.getAuthenticationTrustResolver());

        MockHttpServletResponse response = new MockHttpServletResponse();
        filter.doFilter(request, response, fc);
        assertEquals("/mycontext/login.jsp", response.getRedirectedUrl());
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationTrustResolverImpl

            @Override
            protected SecurityExpressionOperations createSecurityExpressionRoot(
                    Authentication authentication, FilterInvocation fi) {
                WebSecurityExpressionRoot root = new CustomExpressionRoot(authentication, fi);
                root.setPermissionEvaluator(getPermissionEvaluator());
                root.setTrustResolver(new AuthenticationTrustResolverImpl());
                root.setRoleHierarchy(getRoleHierarchy());
                return root;
            }
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationTrustResolverImpl

public class AuthenticationTrustResolverImplTests extends TestCase {

    //~ Methods ========================================================================================================

    public void testCorrectOperationIsAnonymous() {
        AuthenticationTrustResolverImpl trustResolver = new AuthenticationTrustResolverImpl();
        assertTrue(trustResolver.isAnonymous(
                new AnonymousAuthenticationToken("ignored", "ignored", AuthorityUtils.createAuthorityList("ignored"))));
        assertFalse(trustResolver.isAnonymous(
                new TestingAuthenticationToken("ignored", "ignored", AuthorityUtils.createAuthorityList("ignored"))));
    }
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationTrustResolverImpl

        assertFalse(trustResolver.isAnonymous(
                new TestingAuthenticationToken("ignored", "ignored", AuthorityUtils.createAuthorityList("ignored"))));
    }

    public void testCorrectOperationIsRememberMe() {
        AuthenticationTrustResolverImpl trustResolver = new AuthenticationTrustResolverImpl();
        assertTrue(trustResolver.isRememberMe(
                new RememberMeAuthenticationToken("ignored", "ignored", AuthorityUtils.createAuthorityList("ignored"))));
        assertFalse(trustResolver.isAnonymous(
                new TestingAuthenticationToken("ignored", "ignored", AuthorityUtils.createAuthorityList("ignored"))));
    }
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationTrustResolverImpl

        assertFalse(trustResolver.isAnonymous(
                new TestingAuthenticationToken("ignored", "ignored", AuthorityUtils.createAuthorityList("ignored"))));
    }

    public void testGettersSetters() {
        AuthenticationTrustResolverImpl trustResolver = new AuthenticationTrustResolverImpl();

        assertEquals(AnonymousAuthenticationToken.class, trustResolver.getAnonymousClass());
        trustResolver.setAnonymousClass(TestingAuthenticationToken.class);
        assertEquals(TestingAuthenticationToken.class, trustResolver.getAnonymousClass());

        assertEquals(RememberMeAuthenticationToken.class, trustResolver.getRememberMeClass());
        trustResolver.setRememberMeClass(TestingAuthenticationToken.class);
        assertEquals(TestingAuthenticationToken.class, trustResolver.getRememberMeClass());
    }
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationTrustResolverImpl

     * @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.AuthenticationTrustResolverImpl

    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.AuthenticationTrustResolverImpl

    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.AuthenticationTrustResolverImpl

    @Override
    protected SecurityExpressionOperations createSecurityExpressionRoot(
            Authentication authentication, FilterInvocation invocation) {
        CustomWebSecurityExpressionRoot root = new CustomWebSecurityExpressionRoot(authentication, invocation);
        root.setPermissionEvaluator(getPermissionEvaluator());
        root.setTrustResolver(new AuthenticationTrustResolverImpl());
        return root;
    }
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationTrustResolverImpl

    @Override
    protected SecurityExpressionOperations createSecurityExpressionRoot(Authentication authentication, FilterInvocation invocation) {
        WebSecurityExpressionRoot root = getExpressionRootInstance(authentication, invocation);
        root.setPermissionEvaluator(getPermissionEvaluator());
        root.setTrustResolver(new AuthenticationTrustResolverImpl());
        return root;
    }
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.