Codota Logo
org.springframework.security.config.annotation.web
Code IndexAdd Codota to your IDE (free)

How to use org.springframework.security.config.annotation.web

Best Java code snippets using org.springframework.security.config.annotation.web (Showing top 20 results out of 4,878)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-security

/**
 * Create a {@link List} of {@link AntPathRequestMatcher} instances that do not
 * specify an {@link HttpMethod}.
 *
 * @param antPatterns the ant patterns to create {@link AntPathRequestMatcher}
 * from
 *
 * @return a {@link List} of {@link AntPathRequestMatcher} instances
 */
public static List<RequestMatcher> antMatchers(String... antPatterns) {
  return antMatchers(null, antPatterns);
}
origin: spring-projects/spring-security

/**
 * Create a {@link List} of {@link RegexRequestMatcher} instances that do not
 * specify an {@link HttpMethod}.
 *
 * @param regexPatterns the regular expressions to create
 * {@link RegexRequestMatcher} from
 *
 * @return a {@link List} of {@link RegexRequestMatcher} instances
 */
public static List<RequestMatcher> regexMatchers(String... regexPatterns) {
  return regexMatchers(null, regexPatterns);
}
origin: spring-projects/spring-security

/**
 * Maps a {@link List} of
 * {@link org.springframework.security.web.util.matcher.AntPathRequestMatcher}
 * instances.
 *
 * @param method the {@link HttpMethod} to use for any
 * {@link HttpMethod}.
 *
 * @return the object that is chained after creating the {@link RequestMatcher}
 */
public C antMatchers(HttpMethod method) {
  return antMatchers(method, new String[] { "/**" });
}
origin: spring-projects/spring-security

private void registerDefaultEntryPoint(H http) {
  ExceptionHandlingConfigurer<H> exceptionHandling = http
      .getConfigurer(ExceptionHandlingConfigurer.class);
  if (exceptionHandling == null) {
    return;
  }
  exceptionHandling.defaultAuthenticationEntryPointFor(
      this.authenticationEntryPoint,
      this.requestMatcher);
}
origin: spring-projects/spring-security

private GrantedAuthoritiesMapper getGrantedAuthoritiesMapper() {
  GrantedAuthoritiesMapper grantedAuthoritiesMapper =
      this.getBuilder().getSharedObject(GrantedAuthoritiesMapper.class);
  if (grantedAuthoritiesMapper == null) {
    grantedAuthoritiesMapper = this.getGrantedAuthoritiesMapperBean();
    if (grantedAuthoritiesMapper != null) {
      this.getBuilder().setSharedObject(GrantedAuthoritiesMapper.class, grantedAuthoritiesMapper);
    }
  }
  return grantedAuthoritiesMapper;
}
origin: spring-projects/spring-security

@Override
public void configure(H http) throws Exception {
  X509AuthenticationFilter filter = getFilter(http
      .getSharedObject(AuthenticationManager.class));
  http.addFilter(filter);
}
origin: spring-projects/spring-security

static <B extends HttpSecurityBuilder<B>> ClientRegistrationRepository getClientRegistrationRepository(B builder) {
  ClientRegistrationRepository clientRegistrationRepository = builder.getSharedObject(ClientRegistrationRepository.class);
  if (clientRegistrationRepository == null) {
    clientRegistrationRepository = getClientRegistrationRepositoryBean(builder);
    builder.setSharedObject(ClientRegistrationRepository.class, clientRegistrationRepository);
  }
  return clientRegistrationRepository;
}
origin: spring-projects/spring-security

private AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken> getAuthenticationUserDetailsService(
    H http) {
  if (authenticationUserDetailsService == null) {
    userDetailsService(http.getSharedObject(UserDetailsService.class));
  }
  return authenticationUserDetailsService;
}
origin: spring-projects/spring-security

/**
 * Allows explicit configuration of the {@link RequestCache} to be used. Defaults to
 * try finding a {@link RequestCache} as a shared object. Then falls back to a
 * {@link HttpSessionRequestCache}.
 *
 * @param requestCache the explicit {@link RequestCache} to use
 * @return the {@link RequestCacheConfigurer} for further customization
 */
public RequestCacheConfigurer<H> requestCache(RequestCache requestCache) {
  getBuilder().setSharedObject(RequestCache.class, requestCache);
  return this;
}
origin: spring-projects/spring-security

@Override
public void configure(H http) throws Exception {
  LogoutFilter logoutFilter = createLogoutFilter(http);
  http.addFilter(logoutFilter);
}
origin: spring-projects/spring-security

@Override
public void configure(H http) throws Exception {
  HeaderWriterFilter headersFilter = createHeaderWriterFilter();
  http.addFilter(headersFilter);
}
origin: spring-projects/spring-security

/**
 * Create a {@link List} of
 * {@link org.springframework.security.web.util.matcher.RegexRequestMatcher} instances
 * that do not specify an {@link HttpMethod}.
 *
 * @param regexPatterns the regular expressions to create
 * {@link org.springframework.security.web.util.matcher.RegexRequestMatcher} from
 *
 * @return the object that is chained after creating the {@link RequestMatcher}
 */
public C regexMatchers(String... regexPatterns) {
  Assert.state(!this.anyRequestConfigured, "Can't configure regexMatchers after anyRequest");
  return chainRequestMatchers(RequestMatchers.regexMatchers(regexPatterns));
}
origin: spring-projects/spring-security

/**
 * Maps a {@link List} of
 * {@link org.springframework.security.web.util.matcher.AntPathRequestMatcher}
 * instances that do not care which {@link HttpMethod} is used.
 *
 * @param antPatterns the ant patterns to create
 * {@link org.springframework.security.web.util.matcher.AntPathRequestMatcher} from
 *
 * @return the object that is chained after creating the {@link RequestMatcher}
 */
public C antMatchers(String... antPatterns) {
  Assert.state(!this.anyRequestConfigured, "Can't configure antMatchers after anyRequest");
  return chainRequestMatchers(RequestMatchers.antMatchers(antPatterns));
}
origin: spring-projects/spring-security

@Override
public void configure(H http) throws Exception {
  authenticationFilter.afterPropertiesSet();
  http.addFilter(authenticationFilter);
}
origin: spring-projects/spring-security

@Test(expected = IllegalStateException.class)
public void getConfigurerWhenMultipleConfigurersThenThrowIllegalStateException() throws Exception {
  TestConfiguredSecurityBuilder builder = new TestConfiguredSecurityBuilder(mock(ObjectPostProcessor.class), true);
  builder.apply(new DelegateSecurityConfigurer());
  builder.apply(new DelegateSecurityConfigurer());
  builder.getConfigurer(DelegateSecurityConfigurer.class);
}
origin: spring-projects/spring-security

@Test(expected = IllegalStateException.class)
public void removeConfigurerWhenMultipleConfigurersThenThrowIllegalStateException() throws Exception {
  TestConfiguredSecurityBuilder builder = new TestConfiguredSecurityBuilder(mock(ObjectPostProcessor.class), true);
  builder.apply(new DelegateSecurityConfigurer());
  builder.apply(new DelegateSecurityConfigurer());
  builder.removeConfigurer(DelegateSecurityConfigurer.class);
}
origin: spring-projects/spring-security

  @Override
  public void init(TestConfiguredSecurityBuilder builder) throws Exception {
    builder.apply(CONFIGURER);
  }
}
origin: spring-projects/spring-security

  @Bean
  public MyFilter myFilter(UserDetailsService userDetailsService) {
    return new MyFilter(userDetailsService);
  }
}
origin: spring-projects/spring-security

/**
 * Maps a {@link List} of
 * {@link org.springframework.security.web.util.matcher.RegexRequestMatcher}
 * instances.
 *
 * @param method the {@link HttpMethod} to use or {@code null} for any
 * {@link HttpMethod}.
 * @param regexPatterns the regular expressions to create
 * {@link org.springframework.security.web.util.matcher.RegexRequestMatcher} from
 *
 * @return the object that is chained after creating the {@link RequestMatcher}
 */
public C regexMatchers(HttpMethod method, String... regexPatterns) {
  Assert.state(!this.anyRequestConfigured, "Can't configure regexMatchers after anyRequest");
  return chainRequestMatchers(RequestMatchers.regexMatchers(method, regexPatterns));
}
origin: spring-projects/spring-security

/**
 * Maps a {@link List} of
 * {@link org.springframework.security.web.util.matcher.AntPathRequestMatcher}
 * instances.
 *
 * @param method the {@link HttpMethod} to use or {@code null} for any
 * {@link HttpMethod}.
 * @param antPatterns the ant patterns to create. If {@code null} or empty, then matches on nothing.
 * {@link org.springframework.security.web.util.matcher.AntPathRequestMatcher} from
 *
 * @return the object that is chained after creating the {@link RequestMatcher}
 */
public C antMatchers(HttpMethod method, String... antPatterns) {
  Assert.state(!this.anyRequestConfigured, "Can't configure antMatchers after anyRequest");
  return chainRequestMatchers(RequestMatchers.antMatchers(method, antPatterns));
}
org.springframework.security.config.annotation.web

Most used classes

  • HttpSecurity
    A HttpSecurity is similar to Spring Security's XML element in the namespace configuration. It
  • ExpressionUrlAuthorizationConfigurer$ExpressionInterceptUrlRegistry
  • ExpressionUrlAuthorizationConfigurer$AuthorizedUrl
  • CsrfConfigurer
    AddsCSRF [https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)] protection for the met
  • EnableWebSecurity
  • FormLoginConfigurer,
  • ExceptionHandlingConfigurer,
  • SessionManagementConfigurer,
  • HttpBasicConfigurer,
  • HeadersConfigurer,
  • WebSecurityConfigurerAdapter,
  • WebSecurity,
  • WebSecurity$IgnoredRequestConfigurer,
  • HeadersConfigurer$FrameOptionsConfig,
  • HttpSecurity$RequestMatcherConfigurer,
  • AnonymousConfigurer,
  • RememberMeConfigurer,
  • CorsConfigurer,
  • EnableWebFluxSecurity
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now