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

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

Best Java code snippets using org.springframework.security.config.web.server (Showing top 20 results out of 324)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-security

protected void configure(ServerHttpSecurity http) {
  CorsWebFilter corsFilter = getCorsFilter();
  if (corsFilter != null) {
    http.addFilterAt(this.corsFilter, SecurityWebFiltersOrder.CORS);
  }
}
origin: spring-projects/spring-security

/**
 * Configures the Strict Transport Security response headers
 * @return the {@link HstsSpec} to configure
 */
public HstsSpec hsts() {
  return new HstsSpec();
}
origin: spring-projects/spring-security

/**
 * Configures {@code Referrer-Policy} response header.
 * @return the {@link ReferrerPolicySpec} to configure
 */
public ReferrerPolicySpec referrerPolicy() {
  return new ReferrerPolicySpec();
}
origin: spring-projects/spring-security

@Bean
public SecurityWebFilterChain springSecurityFilter(ServerHttpSecurity http) {
  // @formatter:off
  http
    .authorizeExchange()
      .anyExchange().authenticated()
      .and()
    .oauth2Login()
      .authenticationConverter(authenticationConverter)
      .authenticationManager(authenticationManager());
  return http.build();
  // @formatter:on
}
origin: spring-projects/spring-security

@Bean
SecurityWebFilterChain springSecurity(ServerHttpSecurity http) throws Exception {
  // @formatter:off
  http
    .authorizeExchange()
      .anyExchange().hasAuthority("SCOPE_message:read")
      .and()
    .oauth2ResourceServer()
      .bearerTokenConverter(bearerTokenAuthenticationConverter())
      .jwt()
        .publicKey(publicKey());
  // @formatter:on
  return http.build();
}
origin: spring-projects/spring-security

@Bean
SecurityWebFilterChain springSecurity(ServerHttpSecurity http) throws Exception {
  // @formatter:off
  http
    .authorizeExchange()
      .anyExchange().hasAuthority("message:read")
      .and()
    .oauth2ResourceServer()
      .jwt()
        .jwtAuthenticationConverter(jwtAuthenticationConverter())
        .publicKey(publicKey());
  // @formatter:on
  return http.build();
}
origin: spring-projects/spring-security

  @Bean
  SecurityWebFilterChain authorization(ServerHttpSecurity http) throws Exception {
    // @formatter:off
    http
      .authorizeExchange()
        .anyExchange().denyAll()
        .and()
      .oauth2ResourceServer()
        .jwt()
          .publicKey(publicKey());
    // @formatter:on
    return http.build();
  }
}
origin: spring-projects/spring-security

@Test(expected = IllegalStateException.class)
public void anyExchangeWhenFollowedByMatcherThenThrowsException() {
  this.http
    .authorizeExchange().anyExchange().denyAll()
    .pathMatchers("/never-reached");
}
origin: spring-projects/spring-security

@Bean
SecurityWebFilterChain springSecurity(ServerHttpSecurity http) {
  // @formatter:off
  http
    .oauth2ResourceServer()
      .jwt()
        .authenticationManager(authenticationManager());
  // @formatter:on
  return http.build();
}
origin: spring-projects/spring-security

@Bean
SecurityWebFilterChain springSecurity(ServerHttpSecurity http) {
  // @formatter:off
  http
    .redirectToHttps()
      .portMapper(portMapper());
  // @formatter:on
  return http.build();
}
origin: spring-projects/spring-security

@Test
public void headersWhenDisableAndInvokedExplicitlyThenDefautsUsed() {
  this.headers.disable()
    .headers();
  assertHeaders();
}
origin: spring-projects/spring-security

/**
 * Creates a new instance.
 * @return the new {@link ServerHttpSecurity} instance
 */
public static ServerHttpSecurity http() {
  return new ServerHttpSecurity();
}
origin: spring-projects/spring-security

@Test
public void headersWhenFrameOptionsDisableThenFrameOptionsNotWritten() {
  expectHeaderNamesNotPresent(XFrameOptionsServerHttpHeadersWriter.X_FRAME_OPTIONS);
  this.headers.frameOptions().disable();
  assertHeaders();
}
origin: spring-projects/spring-security

@Test
public void headersWhenContentOptionsDisableThenContentTypeOptionsNotWritten() {
  expectHeaderNamesNotPresent(ContentTypeOptionsServerHttpHeadersWriter.X_CONTENT_OPTIONS);
  this.headers.contentTypeOptions().disable();
  assertHeaders();
}
origin: spring-projects/spring-security

@Test
public void headersWhenXssProtectionDisableThenXssProtectionNotWritten() {
  expectHeaderNamesNotPresent("X-Xss-Protection");
  this.headers.xssProtection().disable();
  assertHeaders();
}
origin: spring-projects/spring-security

@Test
public void headersWhenCacheDisableThenCacheNotWritten() {
  expectHeaderNamesNotPresent(HttpHeaders.CACHE_CONTROL, HttpHeaders.PRAGMA, HttpHeaders.EXPIRES);
  this.headers.cache().disable();
  assertHeaders();
}
origin: spring-projects/spring-security

@Test
public void headersWhenHstsDisableThenHstsNotWritten() {
  expectHeaderNamesNotPresent(StrictTransportSecurityServerHttpHeadersWriter.STRICT_TRANSPORT_SECURITY);
  this.headers.hsts().disable();
  assertHeaders();
}
origin: spring-projects/spring-security

  /**
   * Associates a {@link ServerWebExchangeMatcher} instances
   *
   * @param matcher the {@link ServerWebExchangeMatcher} instance
   *
   * @return the object that is chained after creating the {@link ServerWebExchangeMatcher}
   */
  private T matcher(ServerWebExchangeMatcher matcher) {
    return registerMatcher(matcher);
  }
}
origin: spring-projects/spring-security

public JwtSpec jwt() {
  if (this.jwt == null) {
    this.jwt = new JwtSpec();
  }
  return this.jwt;
}
origin: spring-projects/spring-security

protected void configure(ServerHttpSecurity http) {
  if (this.jwt != null) {
    this.jwt.configure(http);
  }
}
org.springframework.security.config.web.server

Most used classes

  • ServerHttpSecurity
    A ServerHttpSecurity is similar to Spring Security's HttpSecurity but for WebFlux. It allows configu
  • ServerHttpSecurity$AuthorizeExchangeSpec$Access
    Configures the access for a particular set of exchanges.
  • ServerHttpSecurity$AuthorizeExchangeSpec
    Configures authorization
  • ServerHttpSecurity$CsrfSpec
    Configures CSRF Protection [https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Preven
  • ServerHttpSecurity$HttpBasicSpec
    Configures HTTP Basic Authentication
  • ServerHttpSecurity$OAuth2LoginSpec,
  • ServerHttpSecurity$CorsSpec,
  • ServerHttpSecurity$ExceptionHandlingSpec,
  • ServerHttpSecurity$LogoutSpec,
  • ServerHttpSecurity$OAuth2ResourceServerSpec,
  • ServerHttpSecurity$HeaderSpec$CacheSpec,
  • ServerHttpSecurity$HeaderSpec$ContentTypeOptionsSpec,
  • ServerHttpSecurity$HeaderSpec$FrameOptionsSpec,
  • ServerHttpSecurity$HeaderSpec$HstsSpec,
  • ServerHttpSecurity$HeaderSpec$XssProtectionSpec,
  • ServerHttpSecurity$HeaderSpec,
  • ServerHttpSecurity$HttpsRedirectSpec,
  • ServerHttpSecurity$OAuth2ClientSpec,
  • ServerHttpSecurity$OAuth2ResourceServerSpec$JwtSpec
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