From 07a305b8b7c9c159a3cc3cd4ec678f3e1c28fdd5 Mon Sep 17 00:00:00 2001 From: Amanda Anganes Date: Tue, 17 Apr 2012 15:32:07 -0400 Subject: [PATCH] Refactored code to use a single spring context file. This uses the default oauth/authorize and oauth/token URLs, but it seems to be free of the infinite redirect issue. Next up: try putting in our custom URLs. --- .../org.eclipse.wst.common.component | 2 +- .../WEB-INF/{spring => }/data-context.xml | 0 ...ication-context.xml => spring-servlet.xml} | 127 ++++++++++++------ .../WEB-INF/spring/appServlet/controllers.xml | 22 --- .../spring/appServlet/servlet-context.xml | 62 --------- .../src/main/webapp/WEB-INF/web.xml | 50 +++---- 6 files changed, 101 insertions(+), 162 deletions(-) rename openid-connect-server/src/main/webapp/WEB-INF/{spring => }/data-context.xml (100%) rename openid-connect-server/src/main/webapp/WEB-INF/{spring/application-context.xml => spring-servlet.xml} (61%) delete mode 100644 openid-connect-server/src/main/webapp/WEB-INF/spring/appServlet/controllers.xml delete mode 100644 openid-connect-server/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml diff --git a/openid-connect-server/.settings/org.eclipse.wst.common.component b/openid-connect-server/.settings/org.eclipse.wst.common.component index 81d52434b..2495365ac 100644 --- a/openid-connect-server/.settings/org.eclipse.wst.common.component +++ b/openid-connect-server/.settings/org.eclipse.wst.common.component @@ -8,7 +8,7 @@ uses - + uses diff --git a/openid-connect-server/src/main/webapp/WEB-INF/spring/data-context.xml b/openid-connect-server/src/main/webapp/WEB-INF/data-context.xml similarity index 100% rename from openid-connect-server/src/main/webapp/WEB-INF/spring/data-context.xml rename to openid-connect-server/src/main/webapp/WEB-INF/data-context.xml diff --git a/openid-connect-server/src/main/webapp/WEB-INF/spring/application-context.xml b/openid-connect-server/src/main/webapp/WEB-INF/spring-servlet.xml similarity index 61% rename from openid-connect-server/src/main/webapp/WEB-INF/spring/application-context.xml rename to openid-connect-server/src/main/webapp/WEB-INF/spring-servlet.xml index 8a1984a68..d09deb5d4 100644 --- a/openid-connect-server/src/main/webapp/WEB-INF/spring/application-context.xml +++ b/openid-connect-server/src/main/webapp/WEB-INF/spring-servlet.xml @@ -1,54 +1,71 @@ + + + - - + + + + + + + + + + + + - - + - - - + entry-point-ref="oauthAuthenticationEntryPoint"> + + + - - + + - - - + + + + - - - - - - + + + + + + + + @@ -67,7 +84,7 @@ - + @@ -81,28 +98,15 @@ - + - + - - - - - - - - - - - - - @@ -121,6 +125,10 @@ + + + + @@ -147,14 +155,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + diff --git a/openid-connect-server/src/main/webapp/WEB-INF/spring/appServlet/controllers.xml b/openid-connect-server/src/main/webapp/WEB-INF/spring/appServlet/controllers.xml deleted file mode 100644 index 2e1b8ff85..000000000 --- a/openid-connect-server/src/main/webapp/WEB-INF/spring/appServlet/controllers.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - diff --git a/openid-connect-server/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml b/openid-connect-server/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml deleted file mode 100644 index bce5105b8..000000000 --- a/openid-connect-server/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/openid-connect-server/src/main/webapp/WEB-INF/web.xml b/openid-connect-server/src/main/webapp/WEB-INF/web.xml index 4b063fb7b..3ecb2d5a1 100644 --- a/openid-connect-server/src/main/webapp/WEB-INF/web.xml +++ b/openid-connect-server/src/main/webapp/WEB-INF/web.xml @@ -3,44 +3,32 @@ 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"> - - - contextConfigLocation - - /WEB-INF/spring/application-context.xml - - - - - - org.springframework.web.context.ContextLoaderListener - - - - oauth2EndpointUrlFilter - org.springframework.web.filter.DelegatingFilterProxy - - contextAttribute - org.springframework.web.servlet.FrameworkServlet.CONTEXT.appServlet - - - - - oauth2EndpointUrlFilter - /* - + + clientCredentialsTokenEndpointFilter + org.springframework.web.filter.DelegatingFilterProxy + + contextAttribute + org.springframework.web.servlet.FrameworkServlet.CONTEXT.spring + + + springSecurityFilterChain org.springframework.web.filter.DelegatingFilterProxy contextAttribute - org.springframework.web.servlet.FrameworkServlet.CONTEXT.appServlet + org.springframework.web.servlet.FrameworkServlet.CONTEXT.spring + + clientCredentialsTokenEndpointFilter + /oauth/token + + springSecurityFilterChain /* @@ -48,17 +36,13 @@ - appServlet + spring org.springframework.web.servlet.DispatcherServlet - - contextConfigLocation - /WEB-INF/spring/appServlet/servlet-context.xml - 1 - appServlet + spring /