From b0701ea770c940981b2609a5866551cc6ab549ff Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Mon, 10 Aug 2015 09:52:27 -0500 Subject: [PATCH] SEC-3068: Update Tutorial to use POST /logout --- .../WEB-INF/applicationContext-security.xml | 16 ++++---- .../main/webapp/WEB-INF/jsp/listAccounts.jsp | 41 +++++++++++-------- .../src/main/webapp/secure/extreme/index.jsp | 24 ++++++----- .../src/main/webapp/secure/index.jsp | 18 ++++---- 4 files changed, 56 insertions(+), 43 deletions(-) diff --git a/samples/tutorial-xml/src/main/webapp/WEB-INF/applicationContext-security.xml b/samples/tutorial-xml/src/main/webapp/WEB-INF/applicationContext-security.xml index d2e64307bf..fc25528dbc 100644 --- a/samples/tutorial-xml/src/main/webapp/WEB-INF/applicationContext-security.xml +++ b/samples/tutorial-xml/src/main/webapp/WEB-INF/applicationContext-security.xml @@ -1,9 +1,9 @@ +- Sample namespace-based configuration +- +--> - - + + + Allow all other requests. In a real application you should + adopt a whitelisting approach where access is not allowed by default + --> diff --git a/samples/tutorial-xml/src/main/webapp/WEB-INF/jsp/listAccounts.jsp b/samples/tutorial-xml/src/main/webapp/WEB-INF/jsp/listAccounts.jsp index 8bfdf99c47..74eaf5d3f7 100644 --- a/samples/tutorial-xml/src/main/webapp/WEB-INF/jsp/listAccounts.jsp +++ b/samples/tutorial-xml/src/main/webapp/WEB-INF/jsp/listAccounts.jsp @@ -1,13 +1,14 @@ <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> - - - - Accounts - + + + + Accounts +
@@ -32,22 +33,26 @@ Anyone can view this page, but posting to an Account requires login and must be Operations - - ${account.id} - ${account.holder} - ${account.balance} - ${account.overdraft} - - -$20 - -$5 - +$5 - +$20 - - + +${account.id} +${account.holder} +${account.balance} +${account.overdraft} + + -$20 + -$5 + +$5 + +$20 + + -

Logout

+

+

+ + +
diff --git a/samples/tutorial-xml/src/main/webapp/secure/extreme/index.jsp b/samples/tutorial-xml/src/main/webapp/secure/extreme/index.jsp index 01b644bea2..6553fe6c84 100644 --- a/samples/tutorial-xml/src/main/webapp/secure/extreme/index.jsp +++ b/samples/tutorial-xml/src/main/webapp/secure/extreme/index.jsp @@ -1,25 +1,29 @@ -<%@ taglib prefix="authz" uri="http://www.springframework.org/security/tags" %> +<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> - - - - Secure Page - + + + + Secure Page +

VERY Secure Page

This is a protected page. You can only see me if you are a supervisor. - - You have authority "supervisor" (this text is surrounded by <authz:authorize> tags). - + +You have authority "supervisor" (this text is surrounded by <sec:authorize> tags). +

Home

-

Logout

+ +
+ + +
diff --git a/samples/tutorial-xml/src/main/webapp/secure/index.jsp b/samples/tutorial-xml/src/main/webapp/secure/index.jsp index 4b7455abde..e41003a808 100644 --- a/samples/tutorial-xml/src/main/webapp/secure/index.jsp +++ b/samples/tutorial-xml/src/main/webapp/secure/index.jsp @@ -4,11 +4,11 @@ - - - - Secure Page - + + + + Secure Page +
@@ -19,7 +19,7 @@ or if you've authenticated this session.

- You are a supervisor! You can therefore see the extremely secure page.

+ You are a supervisor! You can therefore see the extremely secure page.

Properties obtained using <sec:authentication /> tag

@@ -43,7 +43,11 @@ or if you've authenticated this session.

Home

-

Logout

+ +
+ + +