Review Board 1.7.22


Add OAuth support in content proxy to access protected resources with content

Review Request #5112 - Created May 14, 2012 and submitted

Xiao Feng Yu
Shindig-1773
Reviewers
shindig
brianlil, ddumont, rbaxter, ssievers
shindig
Couple of changes are included in this patch.
1) On the client side, the getProxyUrl is updated to add auth parameter to specify the auth scheme used, also check for the AUTHORIZATION and OAUTH_SERVICE setting and add them in proxy url.
2) On the server side, proxy servlet will pass additional HttpServletRequest to ProxyHandler to build the HttpRequest object, in the ProxyHandler additional information as security token, auth type, oauth service and gadget will be used to construct a HttpRequest to pass to the DefaultRequestPipeline for handling.

 

Diff revision 8

This is not the most recent revision of the diff. The latest diff is revision 9. See what's changed.

1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9

  1. http://svn.apache.org/repos/asf/shindig/trunk/config/container.js: Loading...
  2. http://svn.apache.org/repos/asf/shindig/trunk/config/oauth2.json: Loading...
  3. http://svn.apache.org/repos/asf/shindig/trunk/content/samplecontainer/examples/commoncontainer/gadgetCollections.json: Loading...
  4. http://svn.apache.org/repos/asf/shindig/trunk/content/samplecontainer/examples/oauth2/oauth2_spring_proxy.xml: Loading...
  5. http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/core.io/io.js: Loading...
  6. http://svn.apache.org/repos/asf/shindig/trunk/features/src/test/javascript/features/core.io/iotest.js: Loading...
  7. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ProxyServlet.java: Loading...
  8. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/uri/ProxyUriBase.java: Loading...
  9. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/uri/ProxyUriManager.java: Loading...
  10. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/uri/UriCommon.java: Loading...
  11. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/ProxyHandlerTest.java: Loading...
  12. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/ProxyServletTest.java: Loading...
  13. http://svn.apache.org/repos/asf/shindig/trunk/java/server-resources/src/main/webapp/WEB-INF/web.xml: Loading...
http://svn.apache.org/repos/asf/shindig/trunk/config/container.js
Revision 1341572 New Change
[20] 153 lines
[+20]
154
// See individual feature.xml files for configuration details.
154
// See individual feature.xml files for configuration details.
155
"gadgets.features" : {
155
"gadgets.features" : {
156
  "core.io" : {
156
  "core.io" : {
157
    // Note: ${Cur['gadgets.uri.proxy.path']} is an open proxy. Be careful how you expose this!
157
    // Note: ${Cur['gadgets.uri.proxy.path']} is an open proxy. Be careful how you expose this!
158
    // Note: These urls should be protocol relative (start with //)
158
    // Note: These urls should be protocol relative (start with //)
159
    "proxyUrl" : "//${Cur['default.domain.unlocked.client']}${Cur['gadgets.uri.proxy.path']}?container=%container%&refresh=%refresh%&url=%url%%rewriteMime%",
159
    "proxyUrl" : "//${Cur['default.domain.unlocked.client']}${Cur['gadgets.uri.proxy.path']}?container=%container%&refresh=%refresh%&url=%url%%authz%%rewriteMime%",
160
    "jsonProxyUrl" : "//${Cur['default.domain.locked.client']}${CONTEXT_ROOT}/gadgets/makeRequest",
160
    "jsonProxyUrl" : "//${Cur['default.domain.locked.client']}${CONTEXT_ROOT}/gadgets/makeRequest",
161
    // Note: this setting MUST be supplied in every container config object, as there is no default if it is not supplied.
161
    // Note: this setting MUST be supplied in every container config object, as there is no default if it is not supplied.
162
    "unparseableCruft" : "throw 1; < don't be evil' >"
162
    "unparseableCruft" : "throw 1; < don't be evil' >"
163
  },
163
  },
164
  "views" : {
164
  "views" : {
[+20] [20] 160 lines
http://svn.apache.org/repos/asf/shindig/trunk/config/oauth2.json
Revision 1341572 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/content/samplecontainer/examples/commoncontainer/gadgetCollections.json
Revision 1340019 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/content/samplecontainer/examples/oauth2/oauth2_spring_proxy.xml
New File
 
http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/core.io/io.js
Revision 1341572 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/features/src/test/javascript/features/core.io/iotest.js
Revision 1341572 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ProxyServlet.java
Revision 1341572 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/uri/ProxyUriBase.java
Revision 1341572 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/uri/ProxyUriManager.java
Revision 1341572 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/uri/UriCommon.java
Revision 1341572 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/ProxyHandlerTest.java
Revision 1341572 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/ProxyServletTest.java
Revision 1341572 New Change
 
http://svn.apache.org/repos/asf/shindig/trunk/java/server-resources/src/main/webapp/WEB-INF/web.xml
Revision 1341572 New Change
 
  1. http://svn.apache.org/repos/asf/shindig/trunk/config/container.js: Loading...
  2. http://svn.apache.org/repos/asf/shindig/trunk/config/oauth2.json: Loading...
  3. http://svn.apache.org/repos/asf/shindig/trunk/content/samplecontainer/examples/commoncontainer/gadgetCollections.json: Loading...
  4. http://svn.apache.org/repos/asf/shindig/trunk/content/samplecontainer/examples/oauth2/oauth2_spring_proxy.xml: Loading...
  5. http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/core.io/io.js: Loading...
  6. http://svn.apache.org/repos/asf/shindig/trunk/features/src/test/javascript/features/core.io/iotest.js: Loading...
  7. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ProxyServlet.java: Loading...
  8. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/uri/ProxyUriBase.java: Loading...
  9. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/uri/ProxyUriManager.java: Loading...
  10. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/uri/UriCommon.java: Loading...
  11. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/ProxyHandlerTest.java: Loading...
  12. http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/ProxyServletTest.java: Loading...
  13. http://svn.apache.org/repos/asf/shindig/trunk/java/server-resources/src/main/webapp/WEB-INF/web.xml: Loading...