Package org.springframework.security.web.util.matcher

Examples of org.springframework.security.web.util.matcher.AntPathRequestMatcher


        .antMatcher("/oauth/token")
        .authorizeRequests().anyRequest().authenticated()
      .and()
        .httpBasic().authenticationEntryPoint(authenticationEntryPoint())
      .and()
        .csrf().requireCsrfProtectionMatcher(new AntPathRequestMatcher("/oauth/token")).disable()
        .exceptionHandling().accessDeniedHandler(accessDeniedHandler())
      .and()
        .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
      // @formatter:on
    }
View Full Code Here


    @Override
    protected void configure(HttpSecurity http) throws Exception {
      // @formatter:off 
      http.addFilterBefore(resourceFilter, AbstractPreAuthenticatedProcessingFilter.class)
        .requestMatcher(new NegatedRequestMatcher(new AntPathRequestMatcher("/oauth/**")))
        .authorizeRequests().anyRequest().authenticated().expressionHandler(new OAuth2WebSecurityExpressionHandler())
      .and()
        .anonymous().disable()
        .csrf().disable()
        .exceptionHandling()
View Full Code Here

        .antMatcher("/token")
        .authorizeRequests().anyRequest().authenticated()
      .and()
        .httpBasic().authenticationEntryPoint(authenticationEntryPoint())
      .and()
        .csrf().requireCsrfProtectionMatcher(new AntPathRequestMatcher("/token")).disable()
        .exceptionHandling().accessDeniedHandler(accessDeniedHandler())
      .and()
        .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
      // @formatter:on
    }
View Full Code Here

    @Override
    protected void configure(HttpSecurity http) throws Exception {
      // @formatter:off 
      http.addFilterBefore(resourceFilter, AbstractPreAuthenticatedProcessingFilter.class)
        .requestMatcher(new NegatedRequestMatcher(new AntPathRequestMatcher("/oauth/**")))
        .authorizeRequests().anyRequest().authenticated().expressionHandler(new OAuth2WebSecurityExpressionHandler())
      .and()
        .anonymous().disable()
        .csrf().disable()
        .exceptionHandling()
View Full Code Here

        .antMatcher("/oauth/token")
        .authorizeRequests().anyRequest().authenticated()
      .and()
        .httpBasic().authenticationEntryPoint(authenticationEntryPoint())
      .and()
        .csrf().requireCsrfProtectionMatcher(new AntPathRequestMatcher("/oauth/token")).disable()
        .exceptionHandling().accessDeniedHandler(accessDeniedHandler())
      .and()
        .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
      // @formatter:on
    }
View Full Code Here

                                throw new BadCredentialsException("Not a github user!");
                            }
                            filterChain.doFilter(request, response);
                        }
                    }, ExceptionTranslationFilter.class);
            http.logout().logoutRequestMatcher(new AntPathRequestMatcher("/signout"))
                    .logoutSuccessUrl("/").and().authorizeRequests().anyRequest()
                    .authenticated();
            if (isForceHttps()) {
                http.requiresChannel().anyRequest().requiresSecure();
            }
View Full Code Here

    protected void configure(HttpSecurity http) throws Exception {
      // @formatter:off
      http.authorizeRequests().antMatchers("/login").permitAll().anyRequest()
          .fullyAuthenticated().and().formLogin().loginPage("/login")
          .failureUrl("/login?error").and().logout()
          .logoutRequestMatcher(new AntPathRequestMatcher("/logout")).and()
          .exceptionHandling().accessDeniedPage("/access?error");
      // @formatter:on
    }
View Full Code Here

    @Bean
    @Autowired
    public FilterChainProxy springSecurityFilterChain(Filter filterSecurityInterceptor, Filter authenticationFilter, Filter rememberMeAuthenticationFilter, Filter logoutFilter, Filter exceptionTranslationFilter, Filter securityContextPersistenceFilter) {
        List<SecurityFilterChain> filterChains = newArrayList();
        for (String pattern : PUBLIC_RESOURCES) {
            filterChains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher(applicationUrl(pattern))));
        }

        filterChains.add(new DefaultSecurityFilterChain(AnyRequestMatcher.INSTANCE, securityContextPersistenceFilter, exceptionTranslationFilter, logoutFilter, authenticationFilter, rememberMeAuthenticationFilter, filterSecurityInterceptor));

        return new FilterChainProxy(filterChains);
View Full Code Here

          !"REQUIRES_INSECURE_CHANNEL".equals(value)) {
        throw new IllegalArgumentException("The rule for URL '" + value +
            "' must be one of REQUIRES_SECURE_CHANNEL, REQUIRES_INSECURE_CHANNEL, or ANY_CHANNEL");
      }

      map.put(new AntPathRequestMatcher(entry.getKey()), SecurityConfig.createList(value));
    }
    return map;
  }
View Full Code Here

TOP

Related Classes of org.springframework.security.web.util.matcher.AntPathRequestMatcher

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.