org.springframework.security.config.annotation.authentication.configuration.GlobalAuthenticationConfigurerAdapter Java Examples
The following examples show how to use
org.springframework.security.config.annotation.authentication.configuration.GlobalAuthenticationConfigurerAdapter.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FlowableSecurityAutoConfigurationTest.java From flowable-engine with Apache License 2.0 | 4 votes |
@Test public void withMissingGlobalAuthenticationConfigurerAdapter() { contextRunner .withConfiguration(IDM_CONFIGURATION) .withClassLoader(new FilteredClassLoader(GlobalAuthenticationConfigurerAdapter.class)) .run(context -> assertThat(context) .hasSingleBean(IdmIdentityService.class) .doesNotHaveBean(FlowableSecurityAutoConfiguration.class)); }
Example #2
Source File: JettyEmbeddedContainer.java From gravitee-management-rest-api with Apache License 2.0 | 3 votes |
protected ServletContextHandler configureAPI(String apiContextPath, String applicationName, Class<? extends GlobalAuthenticationConfigurerAdapter> securityConfigurationClass) { final ServletContextHandler childContext = new ServletContextHandler(server, apiContextPath, ServletContextHandler.SESSIONS); final ServletHolder servletHolder = new ServletHolder(ServletContainer.class); servletHolder.setInitParameter("javax.ws.rs.Application", applicationName); servletHolder.setInitOrder(0); childContext.addServlet(servletHolder, "/*"); AnnotationConfigWebApplicationContext webApplicationContext = new AnnotationConfigWebApplicationContext(); webApplicationContext.register(securityConfigurationClass); webApplicationContext.setEnvironment((ConfigurableEnvironment) applicationContext.getEnvironment()); webApplicationContext.setParent(applicationContext); childContext.addEventListener(new ContextLoaderListener(webApplicationContext)); // Spring Security filter childContext.addFilter(new FilterHolder(new DelegatingFilterProxy("springSecurityFilterChain")),"/*", EnumSet.allOf(DispatcherType.class)); return childContext; }