Examples of SecurityNamedServiceConfig


Examples of org.geoserver.security.config.SecurityNamedServiceConfig

        } catch (Exception e) {
            throw new IOException(e);
        }

//        BasicAuthenticationFilterConfig authConfig = (BasicAuthenticationFilterConfig) config;
        SecurityNamedServiceConfig authCfg = securityManager.loadAuthenticationProviderConfig("geofence");
        GeoFenceAuthenticationProvider geofenceAuthProvider = geofenceAuth.createAuthenticationProvider(authCfg);
        BasicAuthenticationFilter filter = new BasicAuthenticationFilter(geofenceAuthProvider ,aep);

//        if (authConfig.isUseRememberMe()) {
//            filter.setRememberMeServices(securityManager.getRememberMeService());
View Full Code Here

Examples of org.geoserver.security.config.SecurityNamedServiceConfig

        protected abstract File getRoot() throws IOException;
    }
    class UserGroupServiceHelper extends HelperBase<GeoServerUserGroupService,SecurityUserGroupServiceConfig> {
        public GeoServerUserGroupService load(String name) throws IOException {
           
            SecurityNamedServiceConfig config = loadConfig(name);
            if (config == null) {
                //no such config
                return null;
            }

            //look up the service for this config
            GeoServerUserGroupService service = null;

            for (GeoServerSecurityProvider p : lookupSecurityProviders()) {
                if (p.getUserGroupServiceClass() == null) {
                    continue;
                }
                if (p.getUserGroupServiceClass().getName().equals(config.getClassName())) {
                    service = p.createUserGroupService(config);
                    break;
                }
            }

            if (service == null) {
                throw new IOException("No user group service matching config: " + config);
            }

            service.setSecurityManager(GeoServerSecurityManager.this);
            if (config instanceof SecurityUserGroupServiceConfig){
                boolean needsLockProtection =
                        GeoServerSecurityProvider.getProvider(GeoServerUserGroupService.class,
                        config.getClassName()).roleServiceNeedsLockProtection();
                if (needsLockProtection)
                        service = new LockingUserGroupService(service);
            }
            service.setName(name);
            service.initializeFromConfig(config);
View Full Code Here

Examples of org.geoserver.security.config.SecurityNamedServiceConfig

         /**
         * Loads the role service for the named config from persistence.
         */
        public GeoServerRoleService load(String name) throws IOException {
           
            SecurityNamedServiceConfig config = loadConfig(name);
            if (config == null) {
                //no such config
                return null;
            }

            //look up the service for this config
            GeoServerRoleService service = null;

            for (GeoServerSecurityProvider p  : lookupSecurityProviders()) {
                if (p.getRoleServiceClass() == null) {
                    continue;
                }
                if (p.getRoleServiceClass().getName().equals(config.getClassName())) {
                    service = p.createRoleService(config);
                    break;
                }
            }

            if (service == null) {
                throw new IOException("No authority service matching config: " + config);
            }
            service.setSecurityManager(GeoServerSecurityManager.this);

            if (config instanceof SecurityRoleServiceConfig){
                boolean needsLockProtection =
                        GeoServerSecurityProvider.getProvider(GeoServerRoleService.class,
                        config.getClassName()).roleServiceNeedsLockProtection();
                if (needsLockProtection) {
                        service = new LockingRoleService(service);
                }
            }

View Full Code Here

Examples of org.geoserver.security.config.SecurityNamedServiceConfig

        /**
         * Loads the auth provider for the named config from persistence.
         */
        public GeoServerAuthenticationProvider load(String name) throws IOException {
           
            SecurityNamedServiceConfig config = loadConfig(name);
            if (config == null) {
                //no such config
                return null;
            }

            //look up the service for this config
            GeoServerAuthenticationProvider authProvider = null;

            for (GeoServerSecurityProvider p  : lookupSecurityProviders()) {
                if (p.getAuthenticationProviderClass() == null) {
                    continue;
                }
                if (p.getAuthenticationProviderClass().getName().equals(config.getClassName())) {
                    authProvider = p.createAuthenticationProvider(config);
                    break;
                }
            }

View Full Code Here

Examples of org.geoserver.security.config.SecurityNamedServiceConfig

        /**
         * Loads the filter for the named config from persistence.
         */
        public GeoServerSecurityFilter load(String name) throws IOException {
           
            SecurityNamedServiceConfig config = loadConfig(name);
            if (config == null) {
                //no such config
                return null;
            }

            //look up the service for this config
            GeoServerSecurityFilter filter = null;

            for (GeoServerSecurityProvider p  : lookupSecurityProviders()) {
                if (p.getFilterClass() == null) {
                    continue;
                }
                if (p.getFilterClass().getName().equals(config.getClassName())) {
                    filter = p.createFilter(config);
                    break;
                }
            }

View Full Code Here

Examples of org.geoserver.security.config.SecurityNamedServiceConfig

                    break;
                }                   
            }
        }
        for (String name : listRoleServices()) {
            SecurityNamedServiceConfig config = roleServiceHelper.loadConfig(name);
            for (Class<?> classWithEncryption : configClasses) {
                if (config.getClass().isAssignableFrom(classWithEncryption)) {
                    roleServiceHelper.saveConfig(config);
                    break;
                }                   
            }
        }
        for (String name : listUserGroupServices()) {
            SecurityNamedServiceConfig config = userGroupServiceHelper.loadConfig(name);
            for (Class<?> classWithEncryption : configClasses) {
                if (config.getClass().isAssignableFrom(classWithEncryption)) {
                    userGroupServiceHelper.saveConfig(config);
                    break;
                }                   
            }
        }
       
        for (String name : listAuthenticationProviders()) {
            SecurityNamedServiceConfig config = authProviderHelper.loadConfig(name);
            for (Class<?> classWithEncryption : configClasses) {
                if (config.getClass().isAssignableFrom(classWithEncryption)) {
                    authProviderHelper.saveConfig(config);
                    break;
                }                   
            }
        }
       
        for (String name : listFilters()) {
            SecurityNamedServiceConfig config = filterHelper.loadConfig(name);
            for (Class<?> classWithEncryption : configClasses) {
                if (config.getClass().isAssignableFrom(classWithEncryption)) {
                    filterHelper.saveConfig(config);
                    break;
                }                   
            }
        }
View Full Code Here

Examples of org.geoserver.security.config.SecurityNamedServiceConfig

    public void validateFilterConfig(ExceptionTranslationFilterConfig config) throws FilterConfigException {
       
       
        if (isNotEmpty(config.getAuthenticationFilterName())) {           
            try {
                SecurityNamedServiceConfig filterConfig = manager.loadFilterConfig(config.getAuthenticationFilterName());
                if (filterConfig==null)
                    throw createFilterException(FilterConfigException.INVALID_ENTRY_POINT,
                            config.getAuthenticationFilterName());
               
                boolean valid=false;
View Full Code Here

Examples of org.geoserver.security.config.SecurityNamedServiceConfig

        config.setMaxLength(max);
        return config;
    }

    protected SecurityNamedServiceConfig createFilterConfig(String name, Class<?> aClass) {
        SecurityNamedServiceConfig config = new BaseSecurityNamedServiceConfig();
        config.setName(name);
        config.setClassName(aClass.getName());
        return config;
    }
View Full Code Here

Examples of org.geoserver.security.config.SecurityNamedServiceConfig


    @Override
    protected void onSetUp(SystemTestData testData) throws Exception {

        SecurityNamedServiceConfig filterCfg = new BaseSecurityNamedServiceConfig();
        filterCfg.setName("custom");
        filterCfg.setClassName(AuthCapturingFilter.class.getName());

        GeoServerSecurityManager secMgr = getSecurityManager();
        secMgr.saveFilter(filterCfg);

        SecurityManagerConfig cfg = secMgr.getSecurityConfig();
        cfg.getFilterChain().insertAfter("/web/**", filterCfg.getName(), GeoServerSecurityFilterChain.REMEMBER_ME_FILTER);
       
//        cfg.getFilterChain().put("/web/**", Arrays.asList(
//            new FilterChainEntry(filterCfg.getName(), Position.AFTER,
//                GeoServerSecurityFilterChain.REMEMBER_ME_FILTER)));
       
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.