Comments (4)
@configuration
@EnableWebSecurity
public class SpringFilterChainConfig {
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.csrf(AbstractHttpConfigurer::disable);
http.cors(AbstractHttpConfigurer::disable);
return http
.authorizeHttpRequests(request -> request
.requestMatchers(HttpMethod.POST, "/api/users").permitAll()
.requestMatchers(HttpMethod.POST, "/api/users/login").permitAll()
.anyRequest()
.authenticated()
).build();
}
}
I have done this still not working is there any work around beacuse I have already implemented in my project and now I cannot change it
from spring-cloud-gateway.
What does "not work" mean? Maybe try the documented way to disable csrf? https://docs.spring.io/spring-security/reference/servlet/exploits/csrf.html#disable-csrf
from spring-cloud-gateway.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
from spring-cloud-gateway.
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.
from spring-cloud-gateway.
Related Issues (20)
- [spring-cloud-gateway-mvc] forward operation has side affects HOT 2
- Add support for multiple proto files in one descriptor for JsonToGrpcGatewayFilterFactory HOT 3
- Gateway issue with image upload. HOT 4
- Spring Cloud Gateway Server MVC rateLimit filter(Bucket4jFilter) will got UnsupportedOperationException when response headers is ReadOnlyHttpHeaders HOT 2
- Gateway MVC forward request but with decoded parameters (%2B becomes +)
- "spring.cloud.gateway.requests" metric not incremented for subsequent cached responses
- Question migrate Apache httpd to spring gateway HOT 6
- 500 when CORS and CircuitBreaker are aplied to the same route HOT 9
- Global exception handling with Spring Cloud Gateway MVC HOT 1
- the gateway can modify the queryparams of the URL by Get request? HOT 4
- X-Forwarded-Prefix not working when using MVC
- org.springframework.core.io.buffer.DefaultDataBuffer cannot be cast to org.springframework.core.io.buffer.NettyDataBuffer HOT 5
- Spring Native doesn't work with Spring Gateway: java.lang.IllegalStateException: Incompatible Tomcat implementation HOT 2
- spring-cloud-gateway cpu100%
- [Question] Routing of the requests with multipart file upload limitations
- Migrate mvc proxy exchange properties to new namespace and deprecate old
- Migrate webflux proxy exchange properties to new namespace and deprecate old
- Migrate server-webflux properties to new namespace and deprecate old
- Migrate server-webmvc properties to new namespace and deprecate old
- Serve Single Page Applications as static files in Spring Cloud Gateway HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-cloud-gateway.