Examples of AnonymousAuthenticationFilter


Examples of org.springframework.security.web.authentication.AnonymousAuthenticationFilter

       
        final UserAttributeEditor attrEditor = new UserAttributeEditor();
        attrEditor.setAsText( anonymousAttr );
        final UserAttribute attr = (UserAttribute) attrEditor.getValue();
       
        final AnonymousAuthenticationFilter filter = new AnonymousAuthenticationFilter(anonymousKey,"anonymousUser",attr.getAuthorities());
        filter.afterPropertiesSet();
        return new HttpServletRequestFilterWrapper( filter );
    }
View Full Code Here

Examples of org.springframework.security.web.authentication.AnonymousAuthenticationFilter

       
        final UserAttributeEditor attrEditor = new UserAttributeEditor();
        attrEditor.setAsText( anonymousAttr );
        final UserAttribute attr = (UserAttribute) attrEditor.getValue();
       
        final AnonymousAuthenticationFilter filter = new AnonymousAuthenticationFilter(anonymousKey,"anonymousUser",attr.getAuthorities());
        filter.afterPropertiesSet();
        return new HttpServletRequestFilterWrapper( filter );
    }
View Full Code Here

Examples of org.springframework.security.web.authentication.AnonymousAuthenticationFilter

    private FilterSecurityInterceptor fsi;

    @Before
    public void setUp() throws Exception {
        AnonymousAuthenticationFilter aaf = new AnonymousAuthenticationFilter("anonymous");
        fsi = new FilterSecurityInterceptor();
        fsi.setAccessDecisionManager(accessDecisionManager);
        fsi.setSecurityMetadataSource(metadataSource);
        AuthenticationEntryPoint authenticationEntryPoint = new LoginUrlAuthenticationEntryPoint("/login");
        ExceptionTranslationFilter etf = new ExceptionTranslationFilter(authenticationEntryPoint);
View Full Code Here

Examples of org.springframework.security.web.authentication.AnonymousAuthenticationFilter

                        " Your login page may not be accessible.");
            }
            return;
        }

        AnonymousAuthenticationFilter anonPF = getFilter(AnonymousAuthenticationFilter.class, filters);
        if (anonPF == null) {
            logger.warn("The login page is being protected by the filter chain, but you don't appear to have" +
                    " anonymous authentication enabled. This is almost certainly an error.");
            return;
        }

        // Simulate an anonymous access with the supplied attributes.
        AnonymousAuthenticationToken token = new AnonymousAuthenticationToken("key", anonPF.getPrincipal(),
                        anonPF.getAuthorities());
        try {
            fsi.getAccessDecisionManager().decide(token, loginRequest, attributes);
        } catch (AccessDeniedException e) {
            logger.warn("Anonymous access to the login page doesn't appear to be enabled. This is almost certainly " +
                    "an error. Please check your configuration allows unauthenticated access to the configured " +
View Full Code Here

Examples of org.springframework.security.web.authentication.AnonymousAuthenticationFilter

    public void init(H http) throws Exception {
        if(authenticationProvider == null) {
            authenticationProvider = new AnonymousAuthenticationProvider(getKey());
        }
        if(authenticationFilter == null) {
            authenticationFilter = new AnonymousAuthenticationFilter(getKey(), principal, authorities);
        }
        authenticationProvider = postProcess(authenticationProvider);
        http.authenticationProvider(authenticationProvider);
    }
View Full Code Here

Examples of org.springframework.security.web.authentication.AnonymousAuthenticationFilter

                            " Your login page may not be accessible.");
                }
                return;
            }

            AnonymousAuthenticationFilter anonPF = (AnonymousAuthenticationFilter) getFilter(AnonymousAuthenticationFilter.class, filters);
            if (anonPF == null) {
                logger.warn("The login page is being protected by the filter chain, but you don't appear to have" +
                        " anonymous authentication enabled. This is almost certainly an error.");
                return;
            }

            // Simulate an anonymous access with the supplied attributes.
            AnonymousAuthenticationToken token = new AnonymousAuthenticationToken("key", anonPF.getUserAttribute().getPassword(),
                            anonPF.getUserAttribute().getAuthorities());
            try {
                fsi.getAccessDecisionManager().decide(token, new Object(), fids.lookupAttributes(loginPage, "POST"));
            } catch (Exception e) {
                logger.warn("Anonymous access to the login page doesn't appear to be enabled. This is almost certainly " +
                        "an error. Please check your configuration allows unauthenticated access to the configured " +
View Full Code Here

Examples of org.springframework.security.web.authentication.AnonymousAuthenticationFilter

    public void init(H http) throws Exception {
        if(authenticationProvider == null) {
            authenticationProvider = new AnonymousAuthenticationProvider(getKey());
        }
        if(authenticationFilter == null) {
            authenticationFilter = new AnonymousAuthenticationFilter(getKey(), principal, authorities);
        }
        authenticationProvider = postProcess(authenticationProvider);
        http.authenticationProvider(authenticationProvider);
    }
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.