oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1430745 - in /incubator/amber/trunk/oauth-2.0/client-demo/src/main: java/org/apache/amber/oauth2/client/demo/ java/org/apache/amber/oauth2/client/demo/controller/ webapp/WEB-INF/views/
Date Wed, 09 Jan 2013 09:28:24 GMT
Author: asanso
Date: Wed Jan  9 09:28:23 2013
New Revision: 1430745

URL: http://svn.apache.org/viewvc?rev=1430745&view=rev
Log:
AMBER-68 - Add integration with Google  OAuth 2.0 for Web Server Applications to client-demo
webapp

Modified:
    incubator/amber/trunk/oauth-2.0/client-demo/src/main/java/org/apache/amber/oauth2/client/demo/Utils.java
    incubator/amber/trunk/oauth-2.0/client-demo/src/main/java/org/apache/amber/oauth2/client/demo/controller/MainController.java
    incubator/amber/trunk/oauth-2.0/client-demo/src/main/java/org/apache/amber/oauth2/client/demo/controller/TokenController.java
    incubator/amber/trunk/oauth-2.0/client-demo/src/main/webapp/WEB-INF/views/index.jsp

Modified: incubator/amber/trunk/oauth-2.0/client-demo/src/main/java/org/apache/amber/oauth2/client/demo/Utils.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/oauth-2.0/client-demo/src/main/java/org/apache/amber/oauth2/client/demo/Utils.java?rev=1430745&r1=1430744&r2=1430745&view=diff
==============================================================================
--- incubator/amber/trunk/oauth-2.0/client-demo/src/main/java/org/apache/amber/oauth2/client/demo/Utils.java
(original)
+++ incubator/amber/trunk/oauth-2.0/client-demo/src/main/java/org/apache/amber/oauth2/client/demo/Utils.java
Wed Jan  9 09:28:23 2013
@@ -46,6 +46,10 @@ public final class Utils {
     public static final String FACEBOOK = "facebook";
     public static final String FACEBOOK_AUTHZ = "https://graph.facebook.com/oauth/authorize";
     public static final String FACEBOOK_TOKEN = "https://graph.facebook.com/oauth/access_token";
+    
+    public static final String GOOGLE = "google";
+    public static final String GOOGLE_AUTHZ = "https://accounts.google.com/o/oauth2/auth";
+    public static final String GOOGLE_TOKEN = "https://accounts.google.com/o/oauth2/token";
 
     public static final String GOWALLA = "gowalla";
     public static final String GOWALLA_AUTHZ = "https://gowalla.com/api/oauth/authorize";

Modified: incubator/amber/trunk/oauth-2.0/client-demo/src/main/java/org/apache/amber/oauth2/client/demo/controller/MainController.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/oauth-2.0/client-demo/src/main/java/org/apache/amber/oauth2/client/demo/controller/MainController.java?rev=1430745&r1=1430744&r2=1430745&view=diff
==============================================================================
--- incubator/amber/trunk/oauth-2.0/client-demo/src/main/java/org/apache/amber/oauth2/client/demo/controller/MainController.java
(original)
+++ incubator/amber/trunk/oauth-2.0/client-demo/src/main/java/org/apache/amber/oauth2/client/demo/controller/MainController.java
Wed Jan  9 09:28:23 2013
@@ -71,6 +71,10 @@ public class MainController {
             selected = true;
             oauthParams.setAuthzEndpoint(Utils.FACEBOOK_AUTHZ);
             oauthParams.setTokenEndpoint(Utils.FACEBOOK_TOKEN);
+        }else if (Utils.GOOGLE.equals(app)) {
+                selected = true;
+                oauthParams.setAuthzEndpoint(Utils.GOOGLE_AUTHZ);
+                oauthParams.setTokenEndpoint(Utils.GOOGLE_TOKEN);
         } else if (Utils.GOWALLA.equals(app)) {
             selected = true;
             oauthParams.setAuthzEndpoint(Utils.GOWALLA_AUTHZ);

Modified: incubator/amber/trunk/oauth-2.0/client-demo/src/main/java/org/apache/amber/oauth2/client/demo/controller/TokenController.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/oauth-2.0/client-demo/src/main/java/org/apache/amber/oauth2/client/demo/controller/TokenController.java?rev=1430745&r1=1430744&r2=1430745&view=diff
==============================================================================
--- incubator/amber/trunk/oauth-2.0/client-demo/src/main/java/org/apache/amber/oauth2/client/demo/controller/TokenController.java
(original)
+++ incubator/amber/trunk/oauth-2.0/client-demo/src/main/java/org/apache/amber/oauth2/client/demo/controller/TokenController.java
Wed Jan  9 09:28:23 2013
@@ -57,7 +57,7 @@ public class TokenController {
                                   HttpServletRequest req) throws OAuthSystemException, IOException
{
 
         try {
-
+ 
             Utils.validateTokenParams(oauthParams);
 
             OAuthClientRequest request = OAuthClientRequest
@@ -67,11 +67,11 @@ public class TokenController {
                 .setRedirectURI(oauthParams.getRedirectUri())
                 .setCode(oauthParams.getAuthzCode())
                 .setGrantType(GrantType.AUTHORIZATION_CODE)
-                .buildQueryMessage();
+                .buildBodyMessage();
 
             OAuthClient client = new OAuthClient(new URLConnectionClient());
             String app = Utils.findCookieValue(req, "app");
-
+  
             OAuthAccessTokenResponse oauthResponse = null;
             Class<? extends OAuthAccessTokenResponse> cl = OAuthJSONAccessTokenResponse.class;
 

Modified: incubator/amber/trunk/oauth-2.0/client-demo/src/main/webapp/WEB-INF/views/index.jsp
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/oauth-2.0/client-demo/src/main/webapp/WEB-INF/views/index.jsp?rev=1430745&r1=1430744&r2=1430745&view=diff
==============================================================================
--- incubator/amber/trunk/oauth-2.0/client-demo/src/main/webapp/WEB-INF/views/index.jsp (original)
+++ incubator/amber/trunk/oauth-2.0/client-demo/src/main/webapp/WEB-INF/views/index.jsp Wed
Jan  9 09:28:23 2013
@@ -40,6 +40,7 @@
 
 <a href="/main/smart_gallery">Smart Gallery</a>
 <a href="/main/facebook">Facebook</a>
+<a href="/main/google">Google</a>
 <a href="/main/github">Github</a>
 <a href="/main/gowalla">Gowalla</a>
 



Mime
View raw message