Package org.geoserver.security.config

Examples of org.geoserver.security.config.CredentialsFromRequestHeaderFilterConfig


    public void initializeFromConfig(SecurityNamedServiceConfig config) throws IOException {
        super.initializeFromConfig(config);

        aep = new Http403ForbiddenEntryPoint();

        CredentialsFromRequestHeaderFilterConfig authConfig = (CredentialsFromRequestHeaderFilterConfig) config;

        userNameHeaderName = authConfig.getUserNameHeaderName();
        passwordHeaderName = authConfig.getPasswordHeaderName();

        userNameRegex = Pattern.compile(authConfig.getUserNameRegex());
        passwordRegex = Pattern.compile(authConfig.getPasswordRegex());
        decodeURI = authConfig.isParseAsUriComponents();

        // digest used to create a cacheKey containing the user password
        try {
            digest = MessageDigest.getInstance("MD5");
        } catch (NoSuchAlgorithmException e) {
View Full Code Here


   
    @Test
    public void testCredentialsFromHeader() throws Exception {
           
           
        CredentialsFromRequestHeaderFilterConfig config = new CredentialsFromRequestHeaderFilterConfig();
        config.setClassName(GeoServerCredentialsFromRequestHeaderFilter.class.getName());
        config.setUserNameHeaderName("X-Credentials");
        config.setPasswordHeaderName("X-Credentials");
        config.setUserNameRegex("private-user=([^&]*)");
        config.setPasswordRegex("private-pw=([^&]*)");
        config.setParseAsUriComponents(true);
        config.setName(testFilterName10);
        getSecurityManager().saveFilter(config);
       
        prepareFilterChain(pattern,
                testFilterName10);
        modifyChain(pattern, false, true,null);
View Full Code Here

TOP

Related Classes of org.geoserver.security.config.CredentialsFromRequestHeaderFilterConfig

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.