From 70595c41ce404ca68aaa6d1b531c6a858492553b Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 23 Dec 2012 23:55:05 +0100 Subject: o Adding Apache Shiro for security. --- src/main/webapp/WEB-INF/shiro.ini | 18 ++++++++++++++++++ src/main/webapp/WEB-INF/web.xml | 15 +++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/main/webapp/WEB-INF/shiro.ini (limited to 'src/main/webapp/WEB-INF') diff --git a/src/main/webapp/WEB-INF/shiro.ini b/src/main/webapp/WEB-INF/shiro.ini new file mode 100644 index 0000000..21015af --- /dev/null +++ b/src/main/webapp/WEB-INF/shiro.ini @@ -0,0 +1,18 @@ +[main] + +authc.loginUrl=/login.jspx +roles.unauthorizedUrl = /access-denied.jsp + +sha256Matcher = org.apache.shiro.authc.credential.Sha256CredentialsMatcher + +myCredentialsMatcher = org.apache.shiro.authc.credential.AllowAllCredentialsMatcher + +myRealm = io.trygvis.esper.testing.web.MissingShiroJdbcRealm +myRealm.authenticationQuery = select 'wat' from person where mail = ? +myRealm.credentialsMatcher = $myCredentialsMatcher + +[urls] + +/external/** = anon + +/login.jspx = authc diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index de37fae..0a48260 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -2,6 +2,20 @@ + + org.apache.shiro.web.env.EnvironmentLoaderListener + + + + ShiroFilter + org.apache.shiro.web.servlet.ShiroFilter + + + + ShiroFilter + /* + + Jersey