protected void checkExistingUGService(String ugServiceName) throws FilterConfigException { if (isNotEmpty(ugServiceName) == false) throw createFilterException(FilterConfigException.USER_GROUP_SERVICE_NEEDED); try { if (manager.listUserGroupServices().contains(ugServiceName) == false) throw createFilterException( FilterConfigException.UNKNOWN_USER_GROUP_SERVICE, ugServiceName); } catch (IOException e) { throw new RuntimeException(e); } }
protected void checkExistingRoleService(String roleServiceName) throws FilterConfigException { if (isNotEmpty(roleServiceName) == false) return; // the active role service should be used try { if (manager.listRoleServices().contains(roleServiceName) == false) throw createFilterException( FilterConfigException.UNKNOWN_ROLE_SERVICE, roleServiceName); } catch (IOException e) { throw new RuntimeException(e); } }
public void validateFilterConfig(UsernamePasswordAuthenticationFilterConfig config) throws FilterConfigException { if (isNotEmpty(config.getUsernameParameterName()) == false) { throw createFilterException(FilterConfigException.USER_PARAMETER_NAME_NEEDED); } if (isNotEmpty(config.getPasswordParameterName()) == false) { throw createFilterException(FilterConfigException.PASSWORD_PARAMETER_NAME_NEEDED); } }
public void validateFilterConfig(SecurityInterceptorFilterConfig config) throws FilterConfigException { if (isNotEmpty(config.getSecurityMetadataSource()) == false) throw createFilterException(FilterConfigException.SECURITY_METADATA_SOURCE_NEEDED); try { lookupBean(config.getSecurityMetadataSource()); } catch (NoSuchBeanDefinitionException ex) { throw createFilterException( FilterConfigException.UNKNOWN_SECURITY_METADATA_SOURCE, config.getSecurityMetadataSource()); } }
public void validateFilterConfig(RequestHeaderAuthenticationFilterConfig config) throws FilterConfigException { if (isNotEmpty(config.getPrincipalHeaderAttribute()) == false) throw createFilterException(FilterConfigException.PRINCIPAL_HEADER_ATTRIBUTE_NEEDED); validateFilterConfig((PreAuthenticatedUserNameFilterConfig) config); }
public void validateFilterConfig(DigestAuthenticationFilterConfig config) throws FilterConfigException { checkExistingUGService(config.getUserGroupServiceName()); if (config.getNonceValiditySeconds() < 0) throw createFilterException(FilterConfigException.INVALID_SECONDS); }
public void validateFilterConfig(RoleFilterConfig config) throws FilterConfigException { if (isNotEmpty(config.getHttpResponseHeaderAttrForIncludedRoles()) == false) { throw createFilterException(FilterConfigException.HEADER_ATTRIBUTE_NAME_REQUIRED); } if (isNotEmpty(config.getRoleConverterName())) { try { lookupBean(config.getRoleConverterName()); } catch (NoSuchBeanDefinitionException ex) { throw createFilterException( FilterConfigException.UNKNOWN_ROLE_CONVERTER, config.getRoleConverterName()); } } }
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; if (filterConfig instanceof SecurityFilterConfig) { if (((SecurityFilterConfig) filterConfig).providesAuthenticationEntryPoint()) valid = true; } if (!valid) { throw createFilterException( FilterConfigException.NO_AUTH_ENTRY_POINT, config.getAuthenticationFilterName()); } } catch (IOException ex) { throw new RuntimeException(ex); } } } }
throw createFilterException(FilterConfigException.ROLE_SOURCE_NEEDED); .Header)) { if (isNotEmpty(config.getRolesHeaderAttribute()) == false) throw createFilterException(FilterConfigException.ROLES_HEADER_ATTRIBUTE_NEEDED); if (isNotEmpty(config.getRoleConverterName())) { try { lookupBean(config.getRoleConverterName()); } catch (NoSuchBeanDefinitionException ex) { throw createFilterException( FilterConfigException.UNKNOWN_ROLE_CONVERTER, config.getRoleConverterName());