From 13ec6048428cc64664df73317c96095a8c7f99d5 Mon Sep 17 00:00:00 2001
From: Rossen Stoyanchev
Date: Thu, 8 Feb 2018 12:49:04 -0500
Subject: [PATCH] Re-enable csrf in booking-faces
---
.../webflow/samples/booking/config/SecurityConfig.java | 5 -----
.../webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml | 3 +++
.../main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml | 3 +++
.../webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml | 4 +++-
.../src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml | 3 +++
.../src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml | 1 +
.../src/main/webapp/WEB-INF/layouts/standard.xhtml | 6 +++++-
booking-faces/src/main/webapp/WEB-INF/login.xhtml | 3 +++
8 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/booking-faces/src/main/java/org/springframework/webflow/samples/booking/config/SecurityConfig.java b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/config/SecurityConfig.java
index 8898767..dcd8d3c 100644
--- a/booking-faces/src/main/java/org/springframework/webflow/samples/booking/config/SecurityConfig.java
+++ b/booking-faces/src/main/java/org/springframework/webflow/samples/booking/config/SecurityConfig.java
@@ -26,11 +26,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.logoutUrl("/spring/logout")
.logoutSuccessUrl("/spring/logoutSuccess")
.and()
-
- // Disable CSRF (won't work with JSF) but ensure last HTTP POST request is saved
- // See https://jira.springsource.org/browse/SEC-2498
-
- .csrf().disable()
.requestCache()
.requestCache(new HttpSessionRequestCache());
diff --git a/booking-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml b/booking-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml
index 33fe411..7959f66 100644
--- a/booking-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml
+++ b/booking-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml
@@ -129,6 +129,9 @@
+
+
+
diff --git a/booking-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml b/booking-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml
index 1f15098..320fd55 100755
--- a/booking-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml
+++ b/booking-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml
@@ -71,6 +71,9 @@
+
+
+
diff --git a/booking-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml b/booking-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml
index 1d8e38b..2420282 100644
--- a/booking-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml
+++ b/booking-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml
@@ -31,7 +31,8 @@
-
+
+
@@ -67,6 +68,7 @@
+
diff --git a/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml b/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml
index cbe13aa..3ac9936 100644
--- a/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml
+++ b/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml
@@ -34,6 +34,9 @@
+
+
+
diff --git a/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml b/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml
index 46dc743..b2290b4 100644
--- a/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml
+++ b/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml
@@ -47,6 +47,7 @@
+
\ No newline at end of file
diff --git a/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml b/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml
index bb14d6b..a54ca0d 100644
--- a/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml
+++ b/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml
@@ -31,7 +31,11 @@