Modified: shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/templates/tags/TemplateBasedTagHandlerTest.java URL: http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/templates/tags/TemplateBasedTagHandlerTest.java?rev=1182565&r1=1182564&r2=1182565&view=diff ============================================================================== --- shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/templates/tags/TemplateBasedTagHandlerTest.java (original) +++ shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/templates/tags/TemplateBasedTagHandlerTest.java Wed Oct 12 20:10:39 2011 @@ -31,6 +31,10 @@ import org.apache.shindig.gadgets.Gadget import org.apache.shindig.gadgets.GadgetException; import org.apache.shindig.gadgets.admin.GadgetAdminModule; import org.apache.shindig.gadgets.oauth.OAuthModule; +import org.apache.shindig.gadgets.oauth2.OAuth2Module; +import org.apache.shindig.gadgets.oauth2.handler.OAuth2HandlerModule; +import org.apache.shindig.gadgets.oauth2.persistence.sample.OAuth2PersistenceModule; +import org.apache.shindig.gadgets.oauth2.OAuth2MessageModule; import org.apache.shindig.gadgets.parse.DefaultHtmlSerializer; import org.apache.shindig.gadgets.parse.GadgetHtmlParser; import org.apache.shindig.gadgets.parse.SocialDataTags; @@ -64,8 +68,7 @@ public class TemplateBasedTagHandlerTest @Before public void setUp() throws Exception { - Injector injector = Guice.createInjector(new GadgetAdminModule(), new DefaultGuiceModule(), - new OAuthModule(), new PropertiesModule()); + Injector injector = Guice.createInjector(new GadgetAdminModule(), new DefaultGuiceModule(), new OAuthModule(), new OAuth2Module(), new PropertiesModule(), new OAuth2PersistenceModule(), new OAuth2MessageModule(), new OAuth2HandlerModule()); parser = injector.getInstance(GadgetHtmlParser.class); processor = injector.getInstance(TemplateProcessor.class); context = new TemplateContext(new Gadget(), null);
Added: shindig/trunk/java/gadgets/src/test/resources/org/apache/shindig/gadgets/oauth2/oauth2_test.json URL: http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/test/resources/org/apache/shindig/gadgets/oauth2/oauth2_test.json?rev=1182565&view=auto ============================================================================== --- shindig/trunk/java/gadgets/src/test/resources/org/apache/shindig/gadgets/oauth2/oauth2_test.json (added) +++ shindig/trunk/java/gadgets/src/test/resources/org/apache/shindig/gadgets/oauth2/oauth2_test.json Wed Oct 12 20:10:39 2011 @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +{ + "gadgetBindings" : { + "http://www.example.com/1" : { + "serviceName" : { + "clientName" : "client1", + "allowModuleOverride" : "true" + } + }, + "http://www.example.com/2" : { + "serviceName" : { + "clientName" : "client2", + "allowModuleOverride" : "false" + } + } + }, + + "clients" : { + "client1" : { + "providerName" : "provider1", + "redirect_uri" : "https://www.example.com/gadgets/oauth2callback", + "type" : "confidential", + "grant_type" : "code", + "client_id" : "clientId1", + "client_secret" : "dmjfouTfdsfu2" + }, + + "client2" : { + "providerName" : "provider2", + "redirect_uri" : "https://www.example.com/gadgets/oauth2callback", + "type" : "public", + "grant_type" : "client_credentials", + "client_id" : "clientId2", + "client_secret" : "dmjfouTfdsfu3" + } + }, + + "providers" : { + "provider1" : { + "client_authentication" : "Basic", + "usesAuthorizationHeader" : "true", + "usesUrlParameter" : "false", + "endpoints" : { + "authorizationUrl" : "http://www.example.com/authorize", + "tokenUrl" : "http://www.example.com/token" + } + }, + + "provider2" : { + "client_authentication" : "STANDARD", + "usesAuthorizationHeader" : "false", + "usesUrlParameter" : "true", + "endpoints" : { + "authorizationUrl" : "http://www.example.com/authorize", + "tokenUrl" : "http://www.example.com/token" + } + } + } +} Modified: shindig/trunk/java/server/pom.xml URL: http://svn.apache.org/viewvc/shindig/trunk/java/server/pom.xml?rev=1182565&r1=1182564&r2=1182565&view=diff ============================================================================== --- shindig/trunk/java/server/pom.xml (original) +++ shindig/trunk/java/server/pom.xml Wed Oct 12 20:10:39 2011 @@ -90,6 +90,7 @@ <directory>${basedir}/../../config</directory> <includes> <include>oauth.json</include> + <include>oauth2.json</include> </includes> </resource> <resource> Modified: shindig/trunk/java/server/src/main/webapp/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/shindig/trunk/java/server/src/main/webapp/WEB-INF/web.xml?rev=1182565&r1=1182564&r2=1182565&view=diff ============================================================================== --- shindig/trunk/java/server/src/main/webapp/WEB-INF/web.xml (original) +++ shindig/trunk/java/server/src/main/webapp/WEB-INF/web.xml Wed Oct 12 20:10:39 2011 @@ -35,6 +35,10 @@ org.apache.shindig.social.core.config.SocialApiGuiceModule: org.apache.shindig.social.sample.SampleModule: org.apache.shindig.gadgets.oauth.OAuthModule: + org.apache.shindig.gadgets.oauth2.OAuth2Module: + org.apache.shindig.gadgets.oauth2.OAuth2MessageModule: + org.apache.shindig.gadgets.oauth2.handler.OAuth2HandlerModule: + org.apache.shindig.gadgets.oauth2.persistence.sample.OAuth2PersistenceModule: org.apache.shindig.common.cache.ehcache.EhCacheModule: org.apache.shindig.sample.shiro.ShiroGuiceModule: org.apache.shindig.sample.container.SampleContainerGuiceModule: @@ -202,6 +206,14 @@ </servlet-class> </servlet> + <!-- OAuth2 callback --> + <servlet> + <servlet-name>oauth2callback</servlet-name> + <servlet-class> + org.apache.shindig.gadgets.servlet.OAuth2CallbackServlet + </servlet-class> + </servlet> + <!-- Metadata RPC --> <servlet> <servlet-name>metadata</servlet-name> @@ -302,6 +314,11 @@ </servlet-mapping> <servlet-mapping> + <servlet-name>oauth2callback</servlet-name> + <url-pattern>/gadgets/oauth2callback</url-pattern> + </servlet-mapping> + + <servlet-mapping> <servlet-name>xml-to-html</servlet-name> <url-pattern>/gadgets/ifr</url-pattern> </servlet-mapping> Modified: shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndServer.java URL: http://svn.apache.org/viewvc/shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndServer.java?rev=1182565&r1=1182564&r2=1182565&view=diff ============================================================================== --- shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndServer.java (original) +++ shindig/trunk/java/server/src/test/java/org/apache/shindig/server/endtoend/EndToEndServer.java Wed Oct 12 20:10:39 2011 @@ -24,6 +24,10 @@ import org.apache.shindig.common.servlet import org.apache.shindig.gadgets.DefaultGuiceModule; import org.apache.shindig.gadgets.admin.GadgetAdminModule; import org.apache.shindig.gadgets.oauth.OAuthModule; +import org.apache.shindig.gadgets.oauth2.OAuth2Module; +import org.apache.shindig.gadgets.oauth2.handler.OAuth2HandlerModule; +import org.apache.shindig.gadgets.oauth2.persistence.sample.OAuth2PersistenceModule; +import org.apache.shindig.gadgets.oauth2.OAuth2MessageModule; import org.apache.shindig.gadgets.servlet.ConcatProxyServlet; import org.apache.shindig.gadgets.servlet.GadgetRenderingServlet; import org.apache.shindig.gadgets.servlet.JsServlet; @@ -127,7 +131,12 @@ public class EndToEndServer { GadgetAdminModule.class.getName(), DefaultGuiceModule.class.getName(), PropertiesModule.class.getName(), - OAuthModule.class.getName() + OAuthModule.class.getName(), + OAuthModule.class.getName(), + OAuth2Module.class.getName(), + OAuth2PersistenceModule.class.getName(), + OAuth2MessageModule.class.getName(), + OAuth2HandlerModule.class.getName() ); initParams.put(GuiceServletContextListener.MODULES_ATTRIBUTE, modules);
