oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1468920 - in /oltu/trunk/demos/client-demo: ./ src/main/java/org/apache/oltu/oauth2/client/demo/controller/ src/main/java/org/apache/oltu/oauth2/client/demo/model/ src/main/webapp/WEB-INF/views/
Date Wed, 17 Apr 2013 14:08:09 GMT
Author: asanso
Date: Wed Apr 17 14:08:09 2013
New Revision: 1468920

URL: http://svn.apache.org/r1468920
Log:
OLTU-99 - Add a decode JWT  to the demo 

Modified:
    oltu/trunk/demos/client-demo/pom.xml
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/TokenController.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_resource.jsp

Modified: oltu/trunk/demos/client-demo/pom.xml
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/pom.xml?rev=1468920&r1=1468919&r2=1468920&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/pom.xml (original)
+++ oltu/trunk/demos/client-demo/pom.xml Wed Apr 17 14:08:09 2013
@@ -55,6 +55,12 @@
       <artifactId>org.apache.oltu.oauth2.client</artifactId>
       <version>${oltu.oauth2.version}</version>
     </dependency>
+    
+   	<dependency>
+      <groupId>org.apache.oltu.oauth2</groupId>
+      <artifactId>org.apache.oltu.oauth2.jwt</artifactId>
+      <version>${oltu.oauth2.version}</version>
+    </dependency>
 
     <!-- OpenId Connect Dependency -->
     <dependency>

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/TokenController.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/TokenController.java?rev=1468920&r1=1468919&r2=1468920&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/TokenController.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/TokenController.java
Wed Apr 17 14:08:09 2013
@@ -37,6 +37,7 @@ import org.apache.oltu.oauth2.client.res
 import org.apache.oltu.oauth2.common.exception.OAuthProblemException;
 import org.apache.oltu.oauth2.common.exception.OAuthSystemException;
 import org.apache.oltu.oauth2.common.message.types.GrantType;
+import org.apache.oltu.oauth2.jwt.JWTUtil;
 import org.apache.oltu.openidconnect.client.response.OpenIdConnectResponse;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.ModelAttribute;
@@ -91,7 +92,12 @@ public class TokenController {
             oauthParams.setRefreshToken(Utils.isIssued(oauthResponse.getRefreshToken()));
             
             if (Utils.GOOGLE.equals(app)){
-            	oauthParams.setIdToken(((OpenIdConnectResponse)oauthResponse).getIdToken());
+            	String idToken = ((OpenIdConnectResponse)oauthResponse).getIdToken();
+            	
+            	oauthParams.setIdToken(idToken);
+            	oauthParams.setHeader(JWTUtil.getHeader(idToken));
+            	oauthParams.setClaimsSet(JWTUtil.getClaimsSet(idToken));
+            	
             }
 
             return new ModelAndView("get_resource");

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=1468920&r1=1468919&r2=1468920&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
Wed Apr 17 14:08:09 2013
@@ -45,6 +45,8 @@ public class OAuthParams {
     private String requestType;
     private String requestMethod;
     private String idToken;
+    private String header;
+    private String claimsSet;
 
     private String errorMessage;
 
@@ -187,5 +189,20 @@ public class OAuthParams {
 	public void setIdToken(String idToken) {
 		this.idToken = idToken;
 	}
-	
+
+	public String getHeader() {
+		return header;
+	}
+
+	public void setHeader(String header) {
+		this.header = header;
+	}
+
+	public String getClaimsSet() {
+		return claimsSet;
+	}
+
+	public void setClaimsSet(String claimsSet) {
+		this.claimsSet = claimsSet;
+	}
 }

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=1468920&r1=1468919&r2=1468920&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 Wed Apr 17
14:08:09 2013
@@ -117,6 +117,14 @@
             <td>ID Token:</td>
             <td><form:input size="70" path="idToken" readonly="true"/></td>
         </tr>
+        <tr>
+            <td>Header:</td>
+            <td><textarea rows="15" cols="80" disabled="true">${oauthParams.header}</textarea></td>
+        </tr>
+        <tr>
+            <td>Claims Set:</td>
+            <td><textarea rows="15" cols="80" disabled="true">${oauthParams.claimsSet}</textarea></td>
+        </tr>
 	</table>
 </form:form>
 	



Mime
View raw message