Package org.geoserver.security.config

Examples of org.geoserver.security.config.SecurityManagerConfig


        config.setUserGroupServiceName("default");
        config.setAuthKeyParamName(authKeyUrlParam);
        config.setAuthKeyMapperName("propertyMapper");                
        getSecurityManager().saveFilter(config);

        SecurityManagerConfig mconfig = getSecurityManager().getSecurityConfig();
        GeoServerSecurityFilterChain filterChain = mconfig.getFilterChain();
        VariableFilterChain chain = (VariableFilterChain)filterChain.getRequestChainByName("default");
        chain.getFilterNames().add(0,filterName);
        getSecurityManager().saveSecurityConfig(mconfig);

        GeoServerAuthenticationKeyFilter authKeyFilter =  (GeoServerAuthenticationKeyFilter)
View Full Code Here


     * realistic
     */
    @Override
    protected List<javax.servlet.Filter> getFilters() {
       
        SecurityManagerConfig mconfig = getSecurityManager().getSecurityConfig();
        GeoServerSecurityFilterChain filterChain = mconfig.getFilterChain();
        VariableFilterChain chain = (VariableFilterChain)filterChain.getRequestChainByName("default");
        List<Filter> result = new ArrayList<Filter>();
        for (String filterName : chain.getCompiledFilterNames()) {
            try {
                result.add(getSecurityManager().loadFilter(filterName));
View Full Code Here

        if (!securityManager.isInitialized()) {
            //nothing to do
            return;
        }

        SecurityManagerConfig config = securityManager.getSecurityConfig();
        GeoServerSecurityFilterChain filterChain =
                new GeoServerSecurityFilterChain(config.getFilterChain());

        // similar to the list of authentication providers
        // adding required providers like GeoServerRootAuthenticationProvider
        filterChain.postConfigure(securityManager);
View Full Code Here

        rap.afterPropertiesSet();
        allAuthProviders.add(rap);

        setProviders(allAuthProviders);

        this.securityConfig = new SecurityManagerConfig(config);
        this.initialized = true;
    }
View Full Code Here

     * object directly, but must call {@link #saveSecurityConfig(SecurityManagerConfig)} in order
     * to persist changes.
     * </p>
     */
    public SecurityManagerConfig getSecurityConfig() {
        return new SecurityManagerConfig(this.securityConfig);
    }
View Full Code Here

     * saves the global security config
     * TODO: use read/write lock rather than full synchronied
     */
    public synchronized void saveSecurityConfig(SecurityManagerConfig config) throws Exception {
       
        SecurityManagerConfig oldConfig = new SecurityManagerConfig(this.securityConfig);
       
        SecurityConfigValidator validator = new SecurityConfigValidator(this);
        validator.validateManagerConfig(config,oldConfig);
       
        //save the current config to fall back to               
       

        // The whole try block should run as a transaction, unfortunately
        // this is not possible with files.
        try {
            //set the new configuration
            init(config);
            if (config.getConfigPasswordEncrypterName().equals(
                    oldConfig.getConfigPasswordEncrypterName())==false){
                updateConfigurationFilesWithEncryptedFields();
            }

            //save out new configuration
            xStreamPersist(new File(getSecurityRoot(), CONFIG_FILENAME), config, globalPersister());
View Full Code Here

            saveAuthenticationProvider(upAuthConfig);
            authProvider = loadAuthenticationProvider(GeoServerAuthenticationProvider.DEFAULT_NAME);
        }

        //save the top level config
        SecurityManagerConfig config = new SecurityManagerConfig();
        config.setRoleServiceName(roleService.getName());
        config.getAuthProviderNames().add(authProvider.getName());
        config.setEncryptingUrlParams(false);

        // start with weak encryption
        config.setConfigPasswordEncrypterName(
            loadPasswordEncoder(GeoServerPBEPasswordEncoder.class, true, false).getName());

        // setup the default remember me service
        RememberMeServicesConfig rememberMeConfig = new RememberMeServicesConfig();
        rememberMeConfig.setClassName(GeoServerTokenBasedRememberMeServices.class.getName());
        config.setRememberMeService(rememberMeConfig);

        config.setFilterChain(GeoServerSecurityFilterChain.createInitialChain());
        saveSecurityConfig(config);

        //TODO: just call initializeFrom
        userGroupService.setSecurityManager(this);
        roleService.setSecurityManager(this);
View Full Code Here

        loConfig.setRedirectURL(GeoServerLogoutFilter.URL_AFTER_LOGOUT);
        saveFilter(loConfig);
       
        if (migratedFrom21== false)
            FileUtils.copyFile(new File(getSecurityRoot(), "config.xml"), oldSecManagerConfig);
        SecurityManagerConfig config = loadSecurityConfig();
        for (RequestFilterChain chain : config.getFilterChain().getRequestChains()) {
            if (chain.getFilterNames().contains(GeoServerSecurityFilterChain.SECURITY_CONTEXT_ASC_FILTER)) {
                chain.setAllowSessionCreation(true);
                chain.getFilterNames().remove(GeoServerSecurityFilterChain.SECURITY_CONTEXT_ASC_FILTER);
            }
            if (chain.getFilterNames().contains(GeoServerSecurityFilterChain.SECURITY_CONTEXT_NO_ASC_FILTER)) {
View Full Code Here

     *
     * @return <code>true</code> if migration has taken place 
     * @throws Exception
     */
    boolean migrateFrom23() throws Exception{
        SecurityManagerConfig config = loadSecurityConfig();
        RequestFilterChain webChain =
                config.getFilterChain().getRequestChainByName(GeoServerSecurityFilterChain.WEB_CHAIN_NAME);
       
        boolean migrated=false;
        List<String>patterns =  webChain.getPatterns();
        if (patterns.contains("/")==false) {
            patterns.add("/");
View Full Code Here

    @Test
    public void testWebLoginChainSessionCreation() throws Exception {
        //GEOS-6077
        GeoServerSecurityManager secMgr = getSecurityManager();
        SecurityManagerConfig config = secMgr.loadSecurityConfig();

        RequestFilterChain chain =
            config.getFilterChain().getRequestChainByName(GeoServerSecurityFilterChain.WEB_LOGIN_CHAIN_NAME);
        assertTrue(chain.isAllowSessionCreation());
    }
View Full Code Here

TOP

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

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.