Class GrpcDisableCsrfHttpConfigurer

java.lang.Object
org.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain, org.springframework.security.config.annotation.web.builders.HttpSecurity>
org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<GrpcDisableCsrfHttpConfigurer, org.springframework.security.config.annotation.web.builders.HttpSecurity>
org.springframework.boot.grpc.server.autoconfigure.security.GrpcDisableCsrfHttpConfigurer
All Implemented Interfaces:
org.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain, org.springframework.security.config.annotation.web.builders.HttpSecurity>

public class GrpcDisableCsrfHttpConfigurer extends org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<GrpcDisableCsrfHttpConfigurer, org.springframework.security.config.annotation.web.builders.HttpSecurity>
A custom AbstractHttpConfigurer that disables CSRF protection for gRPC requests.

This configurer checks the application context to determine if CSRF protection should be disabled for gRPC requests based on the property spring.grpc.server.security.csrf.enabled. By default, CSRF protection is disabled unless explicitly enabled in the application properties.

Since:
1.0.0
Author:
Dave Syer
See Also:
  • AbstractHttpConfigurer
  • HttpSecurity
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    init(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
     

    Methods inherited from class org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer

    disable, getRequestMatcherBuilder, getSecurityContextHolderStrategy, withObjectPostProcessor

    Methods inherited from class org.springframework.security.config.annotation.SecurityConfigurerAdapter

    addObjectPostProcessor, configure, getBuilder, postProcess, setBuilder

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GrpcDisableCsrfHttpConfigurer

      public GrpcDisableCsrfHttpConfigurer()
  • Method Details

    • init

      public void init(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
      Specified by:
      init in interface org.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain, org.springframework.security.config.annotation.web.builders.HttpSecurity>
      Overrides:
      init in class org.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain, org.springframework.security.config.annotation.web.builders.HttpSecurity>