Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial commit

  • Loading branch information...
commit f5a849bf31353149eef4609aca03fd6fba0b327f 0 parents
@dajevu authored
Showing with 1,120 additions and 0 deletions.
  1. +3 −0  .gitignore
  2. +14 −0 RestfulAPI/Readme.txt
  3. +89 −0 RestfulAPI/RestfulAPI.iml
  4. +81 −0 RestfulAPI/pom.xml
  5. +31 −0 RestfulAPI/src/main/java/com/acme/resteasy/resource/UserResource.java
  6. +19 −0 RestfulAPI/src/main/resources/springmvc-servlet.xml
  7. +30 −0 RestfulAPI/src/main/webapp/WEB-INF/web.xml
  8. +5 −0 RestfulAPI/src/main/webapp/index.jsp
  9. +62 −0 RestfulAPI/src/test/java/UserTest.java
  10. +17 −0 Shared/pom.xml
  11. +46 −0 Shared/src/main/java/com.acme/shared/dto/User.java
  12. +29 −0 Shared/src/main/java/com/acme/shared/proxy/UserProxy.java
  13. +75 −0 SpringSecurityAPIBlogDemo.iml
  14. +77 −0 SpringWebApp/SpringWebApp.iml
  15. +72 −0 SpringWebApp/pom.xml
  16. +89 −0 SpringWebApp/src/main/java/com/acme/security/UserDetails.java
  17. +49 −0 SpringWebApp/src/main/java/com/acme/security/UserDetailsService.java
  18. +48 −0 SpringWebApp/src/main/java/com/acme/util/APIHelper.java
  19. +1 −0  SpringWebApp/src/main/resources/application.properties
  20. +42 −0 SpringWebApp/src/main/resources/applicationContext-security.xml
  21. +31 −0 SpringWebApp/src/main/resources/log4j.properties
  22. +20 −0 SpringWebApp/src/main/webapp/Index.jsp
  23. +32 −0 SpringWebApp/src/main/webapp/WEB-INF/web.xml
  24. +158 −0 pom.xml
3  .gitignore
@@ -0,0 +1,3 @@
+/RestfulAPI/target
+/Shared/target
+/Shared/SharedDTO.iml
14 RestfulAPI/Readme.txt
@@ -0,0 +1,14 @@
+
+- Run using mvn jetty:run
+
+- To issue a test request, use: http://localhost:9090/RestfulAPI/api/v1/user/john
+
+ This should result in a json stream:
+
+ {
+ "password" : "799ef92a11af918e3fb741df42934f3b568ed2d93ac1df74f1b8d41a27932a6f",
+ "username" : "john",
+ "fullName" : "John Doe",
+ "desc" : "Admin user"
+ }
+
89 RestfulAPI/RestfulAPI.iml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="web" name="Web">
+ <configuration>
+ <descriptors>
+ <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
+ </descriptors>
+ <webroots>
+ <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
+ </webroots>
+ </configuration>
+ </facet>
+ <facet type="Spring" name="Spring">
+ <configuration />
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library" scope="TEST">
+ <library>
+ <CLASSES>
+ <root url="jar://$APPLICATION_HOME_DIR$/lib/junit-4.10.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module" module-name="SharedDTO" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:resteasy-spring:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:resteasy-jaxrs:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:jaxrs-api:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.scannotation:scannotation:1.0.3" level="project" />
+ <orderEntry type="library" name="Maven: javassist:javassist:3.12.1.GA" level="project" />
+ <orderEntry type="library" name="Maven: javax.annotation:jsr250-api:1.0" level="project" />
+ <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.2" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.1.2" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.1.2" level="project" />
+ <orderEntry type="library" name="Maven: net.jcip:jcip-annotations:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:resteasy-jettison-provider:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:resteasy-jaxb-provider:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.4" level="project" />
+ <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.2.3" level="project" />
+ <orderEntry type="library" name="Maven: javax.xml.stream:stax-api:1.0-2" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.jettison:jettison:1.3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:resteasy-jackson-provider:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.8.5" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.8.5" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-jaxrs:1.8.5" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-xc:1.8.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.6.4" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.6.4" level="project" />
+ <orderEntry type="library" name="Maven: log4j:log4j:1.2.16" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-core:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-asm:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-web:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-beans:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-context:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-aop:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-expression:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-context-support:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework.security:spring-security-core:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework.security:spring-security-config:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework.security:spring-security-web:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:3.0.7.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-tx:3.0.7.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework.security:spring-security-taglibs:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework.security:spring-security-acl:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: org.jboss.resteasy:tjws:2.2.1.GA" level="project" />
+ <orderEntry type="library" name="Maven: javax.validation:validation-api:sources:1.0.0.GA" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: javax.servlet:servlet-api:2.5" level="project" />
+ </component>
+</module>
+
81 RestfulAPI/pom.xml
@@ -0,0 +1,81 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <artifactId>SpringSecurityAPIBlogDemo</artifactId>
+ <groupId>SpringSecurityAPIBlogDemo</groupId>
+ <version>1.0</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>RestfulAPI</artifactId>
+ <packaging>war</packaging>
+ <name>RestfulAPI Maven Webapp</name>
+ <url>http://maven.apache.org</url>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>SpringSecurityAPIBlogDemo</groupId>
+ <artifactId>Shared</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>tjws</artifactId>
+ <version>2.2.1.GA</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ <version>1.0.0.GA</version>
+ <classifier>sources</classifier>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.10</version>
+
+ <configuration>
+ <connectors>
+ <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>9090</port>
+ <maxIdleTime>60000</maxIdleTime>
+ </connector>
+ </connectors>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ <stopKey>foo</stopKey>
+ <stopPort>9998</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <finalName>RestfulAPI</finalName>
+ </build>
+</project>
31 RestfulAPI/src/main/java/com/acme/resteasy/resource/UserResource.java
@@ -0,0 +1,31 @@
+package com.acme.resteasy.resource;
+
+import com.acme.shared.dto.User;
+import com.acme.shared.proxy.UserProxy;
+import org.springframework.security.authentication.encoding.ShaPasswordEncoder;
+import org.springframework.stereotype.Controller;
+
+import javax.ws.rs.PathParam;
+
+/**
+ * User: jdavis
+ * Date: 9/16/12
+ * Time: 8:56 PM
+ */
+@Controller
+public class UserResource implements UserProxy {
+
+ ShaPasswordEncoder pe = new ShaPasswordEncoder(256);
+
+ public User getUserByUsername(@PathParam("username") String username) {
+ User user = new User();
+
+ // would normally look up this object from another service (like db), but hard-coding a response for now.
+ user.setUsername("john");
+ user.setPassword(pe.encodePassword("doe", null));
+ user.setFullName("John Doe");
+ user.setDesc("Admin user");
+
+ return user;
+ }
+}
19 RestfulAPI/src/main/resources/springmvc-servlet.xml
@@ -0,0 +1,19 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
+
+
+ <!-- <context:property-placeholder location="file:///opt/properties/default.properties"/> -->
+
+ <context:component-scan base-package="com.acme.resteasy"/>
+
+ <context:annotation-config />
+
+ <import resource="classpath:springmvc-resteasy.xml" />
+
+
+
+
+</beans>
30 RestfulAPI/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+
+ <display-name>Resteasy API Demo</display-name>
+
+ <listener>
+ <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>springmvc</servlet-name>
+ <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+ <init-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>
+ classpath:springmvc-servlet.xml
+ </param-value>
+ </init-param>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>springmvc</servlet-name>
+ <url-pattern>/api/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
5 RestfulAPI/src/main/webapp/index.jsp
@@ -0,0 +1,5 @@
+<html>
+<body>
+<h2>Hello World!</h2>
+</body>
+</html>
62 RestfulAPI/src/test/java/UserTest.java
@@ -0,0 +1,62 @@
+
+import com.acme.shared.dto.User;
+import com.acme.shared.proxy.UserProxy;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.jboss.resteasy.client.ClientRequest;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
+import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.jboss.resteasy.springmvc.tjws.TJWSEmbeddedSpringMVCServer;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.ws.rs.core.MediaType;
+import java.util.Date;
+
+/**
+ * User: jdavis
+ * Date: 9/16/12
+ * Time: 9:25 PM
+ */
+public class UserTest {
+
+ protected static ClientRequest clientRequest;
+ protected static ClientResponse<String> clientResponse;
+ protected static ObjectMapper mapper = new ObjectMapper();
+ static TJWSEmbeddedSpringMVCServer server;
+ protected static final String HOST = "http://localhost:8282";
+
+ @Test
+ public void UserTest() throws Exception {
+ clientRequest = new ClientRequest(HOST + UserProxy.Urls.BASE_URL + UserProxy.Urls.USER);
+
+ // Path Parameters
+ clientRequest.pathParameter("username", "wes@wes.com");
+
+ // GET response
+ clientResponse = clientRequest.accept(MediaType.APPLICATION_JSON).get(String.class);
+
+ // get the HTTP Header Body
+ User user = mapper.readValue(clientResponse.getEntity(), User.class);
+
+ Assert.assertEquals(user.getFullName(), "John Doe");
+ }
+
+ @BeforeClass
+ public static void setup() throws Exception {
+ System.out.println("BeforeClass Start " + new Date());
+
+ server = new TJWSEmbeddedSpringMVCServer("classpath:springmvc-servlet.xml", 8282);
+ server.start();
+
+ RegisterBuiltin.register(ResteasyProviderFactory.getInstance());
+ }
+
+ @AfterClass
+ public static void end() {
+ System.out.println("AfterClass End " + new Date());
+ server.stop();
+ }
+}
17 Shared/pom.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>SpringSecurityAPIBlogDemo</artifactId>
+ <groupId>SpringSecurityAPIBlogDemo</groupId>
+ <version>1.0</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>Shared</artifactId>
+
+ <packaging>jar</packaging>
+
+
+</project>
46 Shared/src/main/java/com.acme/shared/dto/User.java
@@ -0,0 +1,46 @@
+package com.acme.shared.dto;
+
+/**
+ * User: jdavis
+ * Date: 9/16/12
+ * Time: 7:32 PM
+ */
+public class User {
+
+ private String fullName;
+ private String username;
+ private String desc;
+ private String password;
+
+ public String getFullName() {
+ return fullName;
+ }
+
+ public void setFullName(String fullName) {
+ this.fullName = fullName;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getDesc() {
+ return desc;
+ }
+
+ public void setDesc(String desc) {
+ this.desc = desc;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+}
29 Shared/src/main/java/com/acme/shared/proxy/UserProxy.java
@@ -0,0 +1,29 @@
+package com.acme.shared.proxy;
+
+import com.acme.shared.dto.User;
+
+import javax.ws.rs.*;
+import javax.ws.rs.core.MediaType;
+
+/**
+ * User: jdavis
+ * Date: 9/16/12
+ * Time: 8:15 PM
+ */
+
+
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Path(UserProxy.Urls.BASE_URL)
+public interface UserProxy {
+
+ public interface Urls {
+ public static final String BASE_URL = "/api/v1";
+ public static final String USER = "/user/{username}";
+ }
+
+ @GET
+ @Produces( { MediaType.APPLICATION_JSON })
+ @Path(UserProxy.Urls.USER)
+ public User getUserByUsername(@PathParam("username") String username);
+}
75 SpringSecurityAPIBlogDemo.iml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="web" name="Web">
+ <configuration>
+ <descriptors>
+ <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/SpringWebApp/src/main/webapp/WEB-INF/web.xml" />
+ </descriptors>
+ <webroots>
+ <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
+ </webroots>
+ <sourceRoots>
+ <root url="file://$MODULE_DIR$/src/main/resources" />
+ </sourceRoots>
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:resteasy-spring:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:resteasy-jaxrs:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:jaxrs-api:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.scannotation:scannotation:1.0.3" level="project" />
+ <orderEntry type="library" name="Maven: javassist:javassist:3.12.1.GA" level="project" />
+ <orderEntry type="library" name="Maven: javax.annotation:jsr250-api:1.0" level="project" />
+ <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.2" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.1.2" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.1.2" level="project" />
+ <orderEntry type="library" name="Maven: net.jcip:jcip-annotations:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:resteasy-jettison-provider:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:resteasy-jaxb-provider:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.4" level="project" />
+ <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.2.3" level="project" />
+ <orderEntry type="library" name="Maven: javax.xml.stream:stax-api:1.0-2" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.jettison:jettison:1.3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:resteasy-jackson-provider:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.8.5" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.8.5" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-jaxrs:1.8.5" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-xc:1.8.5" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.6.4" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.6.4" level="project" />
+ <orderEntry type="library" name="Maven: log4j:log4j:1.2.16" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-core:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-asm:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-web:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-beans:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-context:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-aop:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-expression:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-context-support:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework.security:spring-security-core:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework.security:spring-security-config:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework.security:spring-security-web:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:3.0.7.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-tx:3.0.7.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework.security:spring-security-taglibs:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework.security:spring-security-acl:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: javax.servlet:servlet-api:2.5" level="project" />
+ </component>
+</module>
+
77 SpringWebApp/SpringWebApp.iml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="web" name="Web">
+ <configuration>
+ <descriptors>
+ <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
+ </descriptors>
+ <webroots>
+ <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
+ </webroots>
+ </configuration>
+ </facet>
+ <facet type="Spring" name="Spring">
+ <configuration />
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="SharedDTO" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:resteasy-spring:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:resteasy-jaxrs:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:jaxrs-api:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.scannotation:scannotation:1.0.3" level="project" />
+ <orderEntry type="library" name="Maven: javassist:javassist:3.12.1.GA" level="project" />
+ <orderEntry type="library" name="Maven: javax.annotation:jsr250-api:1.0" level="project" />
+ <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.2" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.1.2" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.1.2" level="project" />
+ <orderEntry type="library" name="Maven: net.jcip:jcip-annotations:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:resteasy-jettison-provider:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:resteasy-jaxb-provider:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.4" level="project" />
+ <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.2.3" level="project" />
+ <orderEntry type="library" name="Maven: javax.xml.stream:stax-api:1.0-2" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.jettison:jettison:1.3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.resteasy:resteasy-jackson-provider:2.3.4.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.8.5" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.8.5" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-jaxrs:1.8.5" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-xc:1.8.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.6.4" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.6.4" level="project" />
+ <orderEntry type="library" name="Maven: log4j:log4j:1.2.16" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-core:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-asm:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-web:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-beans:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-context:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-aop:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-expression:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-context-support:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework.security:spring-security-core:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework.security:spring-security-config:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework.security:spring-security-web:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:3.0.7.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring-tx:3.0.7.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework.security:spring-security-taglibs:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework.security:spring-security-acl:3.1.2.RELEASE" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: javax.servlet:servlet-api:2.5" level="project" />
+ </component>
+</module>
+
72 SpringWebApp/pom.xml
@@ -0,0 +1,72 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>SpringSecurityAPIBlogDemo</artifactId>
+ <groupId>SpringSecurityAPIBlogDemo</groupId>
+ <version>1.0</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>SpringWebApp</artifactId>
+ <packaging>war</packaging>
+ <name>SpringWebApp Maven Webapp</name>
+ <url>http://maven.apache.org</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>SpringSecurityAPIBlogDemo</groupId>
+ <artifactId>Shared</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>SpringWebApp</finalName>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*.*</include>
+ </includes>
+ </resource>
+ </resources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.10</version>
+
+ <configuration>
+ <connectors>
+ <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>8080</port>
+ <maxIdleTime>60000</maxIdleTime>
+ </connector>
+ </connectors>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
89 SpringWebApp/src/main/java/com/acme/security/UserDetails.java
@@ -0,0 +1,89 @@
+package com.acme.security;
+
+import com.acme.shared.dto.User;
+import org.slf4j.LoggerFactory;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * User: jdavis
+ * Date: 9/12/12
+ * Time: 2:06 PM
+ */
+public class UserDetails implements Serializable, org.springframework.security.core.userdetails.UserDetails {
+
+ /**
+ * logger to log error messages and warnings.
+ */
+ public static final org.slf4j.Logger log = LoggerFactory.getLogger(UserDetails.class);
+
+ private String password;
+ private String username;
+ private User user;
+
+ public Collection<? extends GrantedAuthority> getAuthorities() {
+
+ log.debug("Getting authorities");
+
+ //temporary implemention
+ List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
+
+ GrantedAuthority newrole = new SimpleGrantedAuthority("ROLE_ADMIN");
+
+ authorities.add(newrole);
+
+ return authorities;
+ }
+
+ public String getPassword() {
+ log.debug("Calling getPassword(), returning: " + password);
+ return password;
+ }
+
+ public String getUsername() {
+ log.debug("Calling getUsername(), returning: " + username);
+ return username;
+ }
+
+ public boolean isAccountNonExpired() {
+ return true;
+ }
+
+ public boolean isAccountNonLocked() {
+ return true;
+ }
+
+ public boolean isCredentialsNonExpired() {
+ return true;
+ }
+
+ public boolean isEnabled() {
+ return true;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ @Override
+ public String toString() {
+ return "Username is:: " + username + "Password is:: " + password;
+ }
+
+ public User getUser() {
+ return user;
+ }
+
+ public void setUser(User user) {
+ this.user = user;
+ }
+}
49 SpringWebApp/src/main/java/com/acme/security/UserDetailsService.java
@@ -0,0 +1,49 @@
+package com.acme.security;
+
+import com.acme.shared.dto.User;
+import com.acme.util.APIHelper;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.userdetails.UsernameNotFoundException;
+
+/**
+ * User: jdavis
+ * Date: 9/12/12
+ * Time: 3:39 PM
+ */
+
+public class UserDetailsService implements org.springframework.security.core.userdetails.UserDetailsService {
+
+ public static final org.slf4j.Logger log = LoggerFactory.getLogger(UserDetailsService.class);
+
+ @Autowired
+ APIHelper apiHelper;
+
+ public UserDetails loadUserByUsername(String username)
+ throws UsernameNotFoundException {
+
+ User apiUser = null;
+
+ log.debug("Inside loadUserByUsername, username is :: " + username);
+
+ UserDetails userDetails = new UserDetails();
+
+ try {
+ apiUser = apiHelper.getApiUser(username);
+
+ userDetails.setPassword(apiUser.getPassword());
+
+ userDetails.setUsername(username);
+
+ userDetails.setUser(apiUser);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new UsernameNotFoundException("User not found");
+ }
+
+ return userDetails;
+ }
+
+
+}
48 SpringWebApp/src/main/java/com/acme/util/APIHelper.java
@@ -0,0 +1,48 @@
+package com.acme.util;
+
+import com.acme.shared.dto.User;
+import com.acme.shared.proxy.UserProxy;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.jboss.resteasy.client.ClientRequest;
+import org.jboss.resteasy.client.ClientResponse;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import javax.ws.rs.core.MediaType;
+
+/**
+ * User: jdavis
+ * Date: 9/17/12
+ * Time: 10:10 AM
+ */
+@Component
+public class APIHelper {
+
+ protected static ClientRequest clientRequest;
+ protected static ClientResponse<String> clientResponse;
+ protected static ObjectMapper mapper = new ObjectMapper();
+
+ @Value("${API.host}")
+ private String HOST;
+
+ public APIHelper() {};
+
+ public User getApiUser(String username) throws Exception {
+
+ System.out.println("HOST is; " + HOST);
+
+ clientRequest = new ClientRequest(HOST + UserProxy.Urls.BASE_URL + UserProxy.Urls.USER);
+
+ // Path Parameters
+ clientRequest.pathParameter("username", "wes@wes.com");
+
+ // GET response
+ clientResponse = clientRequest.accept(MediaType.APPLICATION_JSON).get(String.class);
+
+ // get the HTTP Header Body
+ User user = mapper.readValue(clientResponse.getEntity(), User.class);
+
+ return user;
+ }
+
+}
1  SpringWebApp/src/main/resources/application.properties
@@ -0,0 +1 @@
+API.host = http://localhost:9090/RestfulAPI
42 SpringWebApp/src/main/resources/applicationContext-security.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:b="http://www.springframework.org/schema/beans" xmlns:security="http://www.springframework.org/schema/security"
+ xmlns:beans="http://www.springframework.org/schema/beans"
+ xmlns:ctx="http://www.springframework.org/schema/context"
+ xmlns:jdbc="http://www.springframework.org/schema/jdbc"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
+ http://www.springframework.org/schema/security
+ http://www.springframework.org/schema/security/spring-security-3.1.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
+ ">
+
+ <ctx:component-scan base-package="com.acme"/>
+
+ <ctx:annotation-config />
+
+ <ctx:property-placeholder location="classpath:application.properties" />
+
+ <http auto-config="true">
+ <remember-me key="rememberMeKey"/>
+ </http>
+
+ <authentication-manager alias="authenticationManager">
+ <authentication-provider user-service-ref="userDetailsSrv">
+ <password-encoder ref="passwordEncoder"/>
+ </authentication-provider>
+ </authentication-manager>
+
+ <beans:bean id="userDetailsSrv" class="com.acme.security.UserDetailsService"/>
+
+
+ <beans:bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.ShaPasswordEncoder">
+ <beans:constructor-arg index="0" value="256"/>
+ </beans:bean>
+
+
+</beans:beans>
31 SpringWebApp/src/main/resources/log4j.properties
@@ -0,0 +1,31 @@
+log4j.rootLogger=DEBUG, CONSOLE, CATALINA
+
+log4j.rootCategory=DEBUG, CONSOLE, CATALINA
+
+### direct log messages to esp.log
+log4j.appender.CATALINA=org.apache.log4j.FileAppender
+log4j.appender.CATALINA.file=${catalina.base}/logs/esp.log
+log4j.appender.CATALINA.encoding=UTF-8
+log4j.appender.CATALINA.layout=org.apache.log4j.PatternLayout
+log4j.appender.CATALINA.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.CATALINA.append=true
+
+### direct log messages to console
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Target=System.out
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %5p (%c:%L) - %m%n
+
+### Resteasy
+log4j.category.org.jboss.resteasy.core=info
+log4j.category.org.jboss.resteasy.plugins.providers=warn
+log4j.category.org.jboss.resteasy.specimpl=warn
+log4j.logger.org.jboss.resteasy.mock=warn
+log4j.logger.org.apache.http=DEBUG
+log4j.logger.httpclient=DEBUG
+
+### Spring Security
+log4j.logger.org.springframework.security=DEBUG
+
+
+
20 SpringWebApp/src/main/webapp/Index.jsp
@@ -0,0 +1,20 @@
+<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
+
+ <html>
+ <head>
+ <title>Home</title>
+ </head>
+ <body>
+ <h1>Home</h1>
+
+ <div>
+ <security:authorize ifAllGranted="ROLE_ADMIN">
+ <h2>Hello Admin</h2>
+ </security:authorize>
+ <security:authorize ifAllGranted="ROLE_ANONYMOUS">
+ <a href="spring_security_login">Login</a>
+ </security:authorize>
+ </div>
+
+ </body>
+ </html>
32 SpringWebApp/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>
+ classpath:applicationContext-security.xml
+ </param-value>
+ </context-param>
+
+ <listener>
+ <listener-class>
+ org.springframework.web.context.ContextLoaderListener
+ </listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>springSecurityFilterChain</filter-name>
+ <filter-class>
+ org.springframework.web.filter.DelegatingFilterProxy
+ </filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>springSecurityFilterChain</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+</web-app>
158 pom.xml
@@ -0,0 +1,158 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>SpringSecurityAPIBlogDemo</groupId>
+ <artifactId>SpringSecurityAPIBlogDemo</artifactId>
+ <packaging>pom</packaging>
+ <version>1.0</version>
+
+ <modules>
+ <module>Shared</module>
+ <module>RestfulAPI</module>
+ <module>SpringWebApp</module>
+ </modules>
+
+ <name>SpringSecurityAPIBlogDemo Maven Webapp</name>
+
+ <repositories>
+ <repository>
+ <id>jboss</id>
+ <url>http://repository.jboss.org/maven2</url>
+ </repository>
+ </repositories>
+
+ <properties>
+ <spring.version>3.1.2.RELEASE</spring.version>
+ <project.version>1.0</project.version>
+ <org.slf4j.version>1.6.4</org.slf4j.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>SpringSecurityAPIBlogDemo</groupId>
+ <artifactId>Shared</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>SpringSecurityAPIBlogDemo</groupId>
+ <artifactId>RestfulAPI</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <!-- Resteasy Configuration -->
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-spring</artifactId>
+ <version>2.3.4.Final</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jackson-provider</artifactId>
+ <version>2.3.4.Final</version>
+ <type>jar</type>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${org.slf4j.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${org.slf4j.version}</version>
+ </dependency>
+
+ <!-- spring -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-core</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-config</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-web</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-taglibs</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ <finalName>SpringSecurityAPIBlogDemo</finalName>
+
+ </build>
+</project>
Please sign in to comment.
Something went wrong with that request. Please try again.