/shiro-guice-resteasy-webapp

Secure RESTful Web Services using Apache Shiro 1.2.3, JBoss RestEasy 3 and Google Guice 3

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

shiro-guice-resteasy-webapp

RESTful Web Services using Apache Shiro 1.2.3, JBoss RestEasy 3 and Google Guice 3

Dependencies included

  • Servlet 2.5
  • JBoss RestEasy 3.0.9.Final
  • 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
  • Application Server (Tomcat, JBoss/WildFly or Jetty)

Building

  • Make the war file mvn clean package
  • Deploy the war file in Tomcat 7 with Eclipse or manually

After Deploy on Application Server

  • The REST WS are accessible under /*
  • Front-End not yet implemented.

Run with Jetty

  • You can run the application with Jetty via Maven doing mvn jetty:run
  • The application gets deployed by default in http://localhost:8080

Creating a Local Maven Archetype

  • Generate an archetype: mvn archetype:create-from-project
  • Go to target/generated-sources/archetype and run mvn install
  • Create a fresh project from Archetype mvn archetype:generate -DarchetypeCatalog=local using com.pampanet:shiro-guice-resteasy-webapp
  • You can select the archetype from Eclipse IDE from the "New Maven Project" Wizard

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