From 3dcea7ace09e433ad21458124ca33cf2aade9ab8 Mon Sep 17 00:00:00 2001 From: "Mark St. Godard" Date: Sat, 3 Sep 2005 21:44:05 +0000 Subject: [PATCH] initial pages for user switching --- .../src/main/webapp/filter/exitUser.jsp | 45 +++++++++++++++++++ .../src/main/webapp/filter/switchUser.jsp | 43 ++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 samples/contacts/src/main/webapp/filter/exitUser.jsp create mode 100644 samples/contacts/src/main/webapp/filter/switchUser.jsp diff --git a/samples/contacts/src/main/webapp/filter/exitUser.jsp b/samples/contacts/src/main/webapp/filter/exitUser.jsp new file mode 100644 index 0000000000..52298bd469 --- /dev/null +++ b/samples/contacts/src/main/webapp/filter/exitUser.jsp @@ -0,0 +1,45 @@ +<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core' %> + +<%@ page import="net.sf.acegisecurity.context.SecurityContextHolder" %> +<%@ page import="net.sf.acegisecurity.Authentication" %> +<%@ page import="net.sf.acegisecurity.ui.AbstractProcessingFilter" %> +<%@ page import="net.sf.acegisecurity.ui.webapp.AuthenticationProcessingFilter" %> +<%@ page import="net.sf.acegisecurity.AuthenticationException" %> + + + + Exit User + + + +

Exit User

+ + + + Your 'Exit User' attempt was not successful, try again.

+ Reason: <%= ((AuthenticationException) session.getAttribute(AbstractProcessingFilter.ACEGI_SECURITY_LAST_EXCEPTION_KEY)).getMessage() %> +
+
+ +
+ + + +
Current User: + + <% + Authentication auth = SecurityContextHolder.getContext().getAuthentication(); + if (auth != null) { %> + + <%= auth.getPrincipal().toString() %> + + <% } %> + + + +
+ +
+ + + diff --git a/samples/contacts/src/main/webapp/filter/switchUser.jsp b/samples/contacts/src/main/webapp/filter/switchUser.jsp new file mode 100644 index 0000000000..28388869e8 --- /dev/null +++ b/samples/contacts/src/main/webapp/filter/switchUser.jsp @@ -0,0 +1,43 @@ +<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core' %> +<%@ page import="net.sf.acegisecurity.ui.AbstractProcessingFilter" %> +<%@ page import="net.sf.acegisecurity.ui.webapp.AuthenticationProcessingFilter" %> +<%@ page import="net.sf.acegisecurity.AuthenticationException" %> + + + + Switch User + + + +

Switch to User

+ +

Valid users: +

+

username marissa, password koala +

username dianne, password emu +

username scott, password wombat +

username bill, password wombat +

username bob, password wombat +

username jane, password wombat +

+ + <%-- this form-login-page form is also used as the + form-error-page to ask for a login again. + --%> + + + Your 'su' attempt was not successful, try again.

+ Reason: <%= ((AuthenticationException) session.getAttribute(AbstractProcessingFilter.ACEGI_SECURITY_LAST_EXCEPTION_KEY)).getMessage() %> +
+
+ +

+ + + +
User:
+ +
+ + +