oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1469205 - in /oltu/trunk/demos/client-demo/src/main: java/org/apache/oltu/oauth2/client/demo/ java/org/apache/oltu/oauth2/client/demo/controller/ java/org/apache/oltu/oauth2/client/demo/model/ webapp/WEB-INF/views/
Date Thu, 18 Apr 2013 07:31:25 GMT
Author: asanso
Date: Thu Apr 18 07:31:25 2013
New Revision: 1469205

URL: http://svn.apache.org/r1469205
Log:
OLTU-100 - Add Linkedin flow in the demo webapp :

* applied patch from Sam Gorial. Thanks!!

Modified:
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/AuthzController.java
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/RedirectController.java
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/model/OAuthParams.java
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_authz.jsp
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_resource.jsp
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/request_token.jsp

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java?rev=1469205&r1=1469204&r2=1469205&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java
Thu Apr 18 07:31:25 2013
@@ -57,9 +57,9 @@ public final class Utils {
     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";
-    public static final String GOWALLA_TOKEN = "https://gowalla.com/api/oauth/access_token";
+    public static final String LINKEDIN = "linkedin";
+    public static final String LINKEDIN_AUTHZ = "https://www.linkedin.com/uas/oauth2/authorization";
+    public static final String LINKEDIN_TOKEN = "https://www.linkedin.com/uas/oauth2/accessToken";
 
     public static final String GITHUB = "github";
     public static final String GITHUB_AUTHZ = "https://github.com/login/oauth/authorize";

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/AuthzController.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/AuthzController.java?rev=1469205&r1=1469204&r2=1469205&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/AuthzController.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/AuthzController.java
Thu Apr 18 07:31:25 2013
@@ -69,6 +69,7 @@ public class AuthzController {
             res.addCookie(new Cookie("tokenEndpoint", oauthParams.getTokenEndpoint()));
             res.addCookie(new Cookie("redirectUri", oauthParams.getRedirectUri()));
             res.addCookie(new Cookie("scope", oauthParams.getScope()));
+            res.addCookie(new Cookie("state", oauthParams.getState()));
             res.addCookie(new Cookie("app", oauthParams.getApplication()));
 
             OAuthClientRequest request = OAuthClientRequest
@@ -77,6 +78,7 @@ public class AuthzController {
                 .setRedirectURI(oauthParams.getRedirectUri())
                 .setResponseType(ResponseType.CODE.toString())
                 .setScope(oauthParams.getScope())
+                .setState(oauthParams.getState())
                 .buildQueryMessage();
 
             return new ModelAndView(new RedirectView(request.getLocationUri()));

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java?rev=1469205&r1=1469204&r2=1469205&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java
Thu Apr 18 07:31:25 2013
@@ -78,10 +78,10 @@ public class MainController {
                 selected = true;
                 oauthParams.setAuthzEndpoint(Utils.GOOGLE_AUTHZ);
                 oauthParams.setTokenEndpoint(Utils.GOOGLE_TOKEN);
-        } else if (Utils.GOWALLA.equals(app)) {
+        } else if (Utils.LINKEDIN.equals(app)) {
             selected = true;
-            oauthParams.setAuthzEndpoint(Utils.GOWALLA_AUTHZ);
-            oauthParams.setTokenEndpoint(Utils.GOWALLA_TOKEN);
+            oauthParams.setAuthzEndpoint(Utils.LINKEDIN_AUTHZ);
+            oauthParams.setTokenEndpoint(Utils.LINKEDIN_TOKEN);
         } else if (Utils.SMART_GALLERY.equals(app)) {
             selected = true;
             oauthRegParams.setAuthzEndpoint(Utils.SMART_GALLERY_AUTHZ);

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/RedirectController.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/RedirectController.java?rev=1469205&r1=1469204&r2=1469205&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/RedirectController.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/RedirectController.java
Thu Apr 18 07:31:25 2013
@@ -67,6 +67,7 @@ public class RedirectController {
             String tokenEndpoint = Utils.findCookieValue(request, "tokenEndpoint");
             String redirectUri = Utils.findCookieValue(request, "redirectUri");
             String scope = Utils.findCookieValue(request, "scope");
+            String state = Utils.findCookieValue(request, "state");
 
             String app = Utils.findCookieValue(request, "app");
             response.addCookie(new Cookie("app", app));
@@ -78,6 +79,7 @@ public class RedirectController {
             oauthParams.setTokenEndpoint(tokenEndpoint);
             oauthParams.setRedirectUri(redirectUri);
             oauthParams.setScope(Utils.isIssued(scope));
+            oauthParams.setState(Utils.isIssued(state));
             oauthParams.setApplication(app);
 
 

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/model/OAuthParams.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/model/OAuthParams.java?rev=1469205&r1=1469204&r2=1469205&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/model/OAuthParams.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/model/OAuthParams.java
Thu Apr 18 07:31:25 2013
@@ -39,6 +39,7 @@ public class OAuthParams {
     private Long expiresIn;
     private String refreshToken;
     private String scope;
+    private String state;
     private String resourceUrl;
     private String resource;
     private String application;
@@ -158,6 +159,14 @@ public class OAuthParams {
     public void setScope(String scope) {
         this.scope = scope;
     }
+    
+    public String getState() {
+		return state;
+	}
+    
+    public void setState(String state) {
+		this.state = state;
+	}
 
     public String getApplication() {
         return application;

Modified: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_authz.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_authz.jsp?rev=1469205&r1=1469204&r2=1469205&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_authz.jsp (original)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_authz.jsp Thu Apr 18 07:31:25
2013
@@ -72,6 +72,10 @@
             <td><form:input size="70" path="redirectUri"/></td>
         </tr>
         <tr>
+            <td>Client State:</td>
+            <td><form:input size="70" path="state"/></td>
+        </tr>
+        <tr>
             <td colspan="2">
                 <form:hidden path="application"/>
                 <input type="submit" value="Get Authorization"/>

Modified: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_resource.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_resource.jsp?rev=1469205&r1=1469204&r2=1469205&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_resource.jsp (original)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_resource.jsp Thu Apr 18
07:31:25 2013
@@ -103,6 +103,10 @@
             <td><form:input size="70" path="redirectUri" readonly="true"/></td>
         </tr>
         <tr>
+            <td>Client State:</td>
+            <td><form:input size="70" path="state" readonly="true"/></td>
+        </tr>
+        <tr>
             <td colspan="2">
                 <form:hidden path="application"/>
                 <input type="submit" value="Get Resource"/>

Modified: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp?rev=1469205&r1=1469204&r2=1469205&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp (original)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp Thu Apr 18 07:31:25
2013
@@ -43,7 +43,7 @@
 <a href="/main/facebook">Facebook</a>
 <a href="/main/google">Google</a>
 <a href="/main/github">Github</a>
-<a href="/main/gowalla">Gowalla</a>
+<a href="/main/linkedin">LinkedIn</a>
 
 
 <h2>JWT decoder</h2>

Modified: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/request_token.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/request_token.jsp?rev=1469205&r1=1469204&r2=1469205&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/request_token.jsp (original)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/request_token.jsp Thu Apr 18
07:31:25 2013
@@ -72,6 +72,10 @@
             <td><form:input size="70" path="redirectUri" readonly="true"/></td>
         </tr>
         <tr>
+            <td>Client State:</td>
+            <td><form:input size="70" path="state" readonly="true"/></td>
+        </tr>
+        <tr>
             <td colspan="2">
                 <form:hidden path="application"/>
                 <input type="submit" value="Get Token"/>



Mime
View raw message