Switched H2 to server-mode and made the console available in the app
authorKai Moritz <kai@juplo.de>
Mon, 1 Feb 2016 15:42:48 +0000 (16:42 +0100)
committerKai Moritz <kai@juplo.de>
Thu, 26 May 2016 13:51:27 +0000 (15:51 +0200)
pom.xml
src/main/java/de/juplo/yourshouter/WebSecurityConfig.java
src/main/resources/application.properties
src/main/webapp/thymeleaf/home.html

diff --git a/pom.xml b/pom.xml
index 30f0bca..510a4ff 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -36,6 +36,9 @@
     <!-- database settings for tests -->
     <jdbc.groupId>com.h2database</jdbc.groupId>
     <jdbc.artifactId>h2</jdbc.artifactId>
+    <jdbc.url><![CDATA[jdbc:h2:~/test;DB_CLOSE_ON_EXIT=FALSE]]></jdbc.url>
+    <jdbc.username>sa</jdbc.username>
+    <jdbc.password></jdbc.password>
   </properties>
 
   <dependencies>
index 2452adc..5b82a12 100644 (file)
@@ -51,11 +51,11 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter
     http
         .csrf()
             /**
-             * The Facebook-Canvas does not send a proper CSRF-token in its
-             * POST-requests. Hence, this feature has to be disabled for all
-             * pages, that receive an initial call from the Facebook-Canvas.
+             * Neither the Facebook-Canvas nor the H2-console does send a proper
+             * CSRF-token in its POST-requests. Hence, this feature has to be
+             * disabled for this pages.
              */
-            .ignoringAntMatchers("/canvas/*")
+            .ignoringAntMatchers("/canvas/*", "/h2-console/*")
             .and()
         .exceptionHandling()
             .authenticationEntryPoint(authenticationEntryPoint)
index 91b0256..be5e940 100644 (file)
@@ -12,7 +12,11 @@ httpclient.timeout.read=@httpclient.timeout.read@
 spring.thymeleaf.prefix=/thymeleaf/
 spring.thymeleaf.cache=false
 
+spring.datasource.url=@jdbc.url@
+spring.datasource.username=@jdbc.username@
+spring.datasource.password=@jdbc.password@
 spring.datasource.continueOnError=true
+spring.h2.console.enabled=true
 
 logging.level.org.springframework.social=debug
 logging.level.org.apache.http=@httpclient.logging.level@
index b4d0074..f7649e5 100644 (file)
@@ -8,6 +8,7 @@
     <ul>
       <li><a href="connect/facebookConnected.html" th:href="@{/connect/facebook.html}">Show connection-status</a></li>
       <li><a href="profile.html" th:href="@{/profile.html}">Show public profile-data</a></li>
+      <li><a href="#" th:href="@{/h2-console}">Connect to the H2-console</a></li>
     </ul>
   </body>
 </html>