/secure-rest-webapp-archetype

Maven Archetype for Building Secure RESTful Web Services with Apache Shiro 1.2.3, Jersey 1.18.1 and Google Guice 3.0

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

secure-rest-webapp-archetype

Secure RESTful Web Services Archetype with Apache Shiro 1.2.3, Jersey 1.18.1 and Google Guice 3.0

Dependencies included

  • Servlet 2.5
  • Jersey 1.18.1
  • Guice 3.0
  • Apache Shiro 1.2.3
  • guice-persist 3.0
  • gson 2.2.4
  • joda-time 2.4
  • JUnit 4.10

Requirements

  • Java 7
  • Maven 3
  • Tomcat 7

Building and Running

#!/bin/bash
### Install the Archetype in your local Maven Repo 
mvn install
### Create a New Maven Project from command line:
mvn archetype:generate -DarchetypeGroupId=com.pampanet \ 
  -DarchetypeArtifactId=secure-rest-webapp-archetype \ 
  -DarchetypeVersion=0.1.0-RELEASE \ 
  -DgroupId=<my.company.name> \ 
  -DartifactId=<sample> \ 
  -DarchetypeRepository=local \ 
  -DinteractiveMode=false

Apache Shiro Filters

  • Shiro's Default Filters: http://shiro.apache.org/web.html#Web-DefaultFilters
  • In com.pampanet.sample.shiro.modules.BootstrapShiroModule are all the filters, placed in order.
  • You can replace com.pampanet.sample.shiro.modules.ShiroAnnotationsModule with Shiro's default ShiroAopModule class.

Apache Shiro Users Configuration