Skip to content

Commit 48a2173

Browse files
authored
CSRF kept (#589)
1 parent b8b412a commit 48a2173

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<repository>
6666
<id>oracleReleases</id>
6767
<name>Oracle Released Java Packages</name>
68-
<url>http://download.oracle.com/maven</url>
68+
<url>https://download.oracle.com/maven</url>
6969
<layout>default</layout>
7070
</repository>
7171
</repositories>

src/main/java/com/ericsson/ei/EndpointSecurity.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ private void configureBasicAuth(HttpSecurity http) throws Exception {
145145

146146
private void disableCSRF(HttpSecurity http) throws Exception {
147147
http.csrf()
148+
// The application uses non-browser clients. Yes, there is swagger interface,
149+
// but is's used only for testing/tuning.
150+
//
151+
// From https://docs.spring.io/spring-security/reference/features/exploits/csrf.html
152+
// "If you are creating a service that is used only by non-browser clients,
153+
// you likely want to disable CSRF protection."
148154
.disable();
149155
}
150156

0 commit comments

Comments
 (0)