File tree 1 file changed +10
-2
lines changed
publish-service/src/main/java/com/ericsson/eiffel/remrem/publish/config
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 30
30
import org .springframework .security .config .annotation .web .configuration .EnableWebSecurity ;
31
31
import org .springframework .security .config .annotation .web .configuration .WebSecurityConfigurerAdapter ;
32
32
33
+ import static org .apache .catalina .webresources .TomcatURLStreamHandlerFactory .disable ;
34
+
33
35
/**
34
36
* This class is used to enable the ldap authentication based on property
35
37
* activedirectory.publish.enabled = true in properties file.
@@ -110,7 +112,13 @@ protected void configure(HttpSecurity http) throws Exception {
110
112
.httpBasic ()
111
113
.authenticationEntryPoint (customAuthenticationEntryPoint )
112
114
.and ()
113
- .csrf ();
114
- // .disable();
115
+ .csrf ()
116
+ // The application uses non-browser clients. Yes, there is swagger interface,
117
+ // but is's used only for testing/tuning.
118
+ //
119
+ // From https://docs.spring.io/spring-security/reference/features/exploits/csrf.html
120
+ // "If you are creating a service that is used only by non-browser clients,
121
+ // you likely want to disable CSRF protection."
122
+ .disable ();
115
123
}
116
124
}
You can’t perform that action at this time.
0 commit comments