oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1524312 - in /oltu/trunk/openid-connect/client/src: main/java/org/apache/oltu/openidconnect/client/response/OpenIdConnectResponse.java test/java/org/apache/oltu/openidconnect/client/response/OpenIdConnectResponseTest.java
Date Wed, 18 Sep 2013 07:28:55 GMT
Author: simonetripodi
Date: Wed Sep 18 07:28:55 2013
New Revision: 1524312

URL: http://svn.apache.org/r1524312
Log:
[OLTU-117] Replace JWTUtils with JWT(Reader|Writer)

JWTUtils replaced by the JWTReader in OpenIDConnectResponse(Test)

Modified:
    oltu/trunk/openid-connect/client/src/main/java/org/apache/oltu/openidconnect/client/response/OpenIdConnectResponse.java
    oltu/trunk/openid-connect/client/src/test/java/org/apache/oltu/openidconnect/client/response/OpenIdConnectResponseTest.java

Modified: oltu/trunk/openid-connect/client/src/main/java/org/apache/oltu/openidconnect/client/response/OpenIdConnectResponse.java
URL: http://svn.apache.org/viewvc/oltu/trunk/openid-connect/client/src/main/java/org/apache/oltu/openidconnect/client/response/OpenIdConnectResponse.java?rev=1524312&r1=1524311&r2=1524312&view=diff
==============================================================================
--- oltu/trunk/openid-connect/client/src/main/java/org/apache/oltu/openidconnect/client/response/OpenIdConnectResponse.java
(original)
+++ oltu/trunk/openid-connect/client/src/main/java/org/apache/oltu/openidconnect/client/response/OpenIdConnectResponse.java
Wed Sep 18 07:28:55 2013
@@ -19,11 +19,11 @@ package org.apache.oltu.openidconnect.cl
 import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse;
 import org.apache.oltu.oauth2.common.exception.OAuthProblemException;
 import org.apache.oltu.oauth2.jwt.JWT;
-import org.apache.oltu.oauth2.jwt.JWTUtils;
+import org.apache.oltu.oauth2.jwt.io.JWTReader;
 import org.apache.oltu.openidconnect.OpenIdConnect;
 
 /**
- * 
+ *
  *
  */
 public class OpenIdConnectResponse extends OAuthJSONAccessTokenResponse {
@@ -34,7 +34,7 @@ public class OpenIdConnectResponse exten
 	protected void init(String body, String contentType, int responseCode)
 			throws OAuthProblemException {
 		super.init(body, contentType, responseCode);
-		idToken = JWTUtils.parseJWT(getParam(OpenIdConnect.ID_TOKEN));
+		idToken = new JWTReader().read(getParam(OpenIdConnect.ID_TOKEN));
 	}
 
 	public final JWT getIdToken() {
@@ -44,8 +44,8 @@ public class OpenIdConnectResponse exten
 	/**
 	 * ID Token Validation as per OpenID Connect
 	 * Basic Client Profile 1.0 draft 22 Section 2.4
-	 * 
-	 * 
+	 *
+	 *
 	 * @param issuer
 	 * @param audience
 	 * @return

Modified: oltu/trunk/openid-connect/client/src/test/java/org/apache/oltu/openidconnect/client/response/OpenIdConnectResponseTest.java
URL: http://svn.apache.org/viewvc/oltu/trunk/openid-connect/client/src/test/java/org/apache/oltu/openidconnect/client/response/OpenIdConnectResponseTest.java?rev=1524312&r1=1524311&r2=1524312&view=diff
==============================================================================
--- oltu/trunk/openid-connect/client/src/test/java/org/apache/oltu/openidconnect/client/response/OpenIdConnectResponseTest.java
(original)
+++ oltu/trunk/openid-connect/client/src/test/java/org/apache/oltu/openidconnect/client/response/OpenIdConnectResponseTest.java
Wed Sep 18 07:28:55 2013
@@ -17,20 +17,20 @@
 package org.apache.oltu.openidconnect.client.response;
 import junitx.util.PrivateAccessor;
 
-import org.apache.oltu.oauth2.jwt.JWTUtils;
+import org.apache.oltu.oauth2.jwt.JWT;
+import org.apache.oltu.oauth2.jwt.io.JWTReader;
 import org.junit.Assert;
 import org.junit.Test;
-import org.apache.oltu.oauth2.jwt.JWT;
 
 public class OpenIdConnectResponseTest extends Assert{
 	private final String JWT = "eyJhbGciOiJSUzI1NiIsImtpZCI6ImJlMWRhMGIzNTY3YmQyNjVhMjUwOThmYmNjMmIwOWYyMTM0NWIzYTIifQ.eyJpc3MiOiJhY2NvdW50cy5nb29nbGUuY29tIiwiaWQiOiIxMDY0MjI0NTMwODI0Nzk5OTg0MjkiLCJzdWIiOiIxMDY0MjI0NTMwODI0Nzk5OTg0MjkiLCJ2ZXJpZmllZF9lbWFpbCI6InRydWUiLCJlbWFpbF92ZXJpZmllZCI6InRydWUiLCJhdWQiOiI3ODg3MzIzNzIwNzguYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJjaWQiOiI3ODg3MzIzNzIwNzguYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJhenAiOiI3ODg3MzIzNzIwNzguYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJlbWFpbCI6ImFudG9uaW8uc2Fuc29AZ21haWwuY29tIiwidG9rZW5faGFzaCI6IkwySTc3Z2lCTGswUlNzMHpRMVN2Q0EiLCJhdF9oYXNoIjoiTDJJNzdnaUJMazBSU3MwelExU3ZDQSIsImlhdCI6MTM2NjcyNjMxNywiZXhwIjoxMzY2NzMwMjE3fQ.XWYi5Zj1YWAMGIml_ftoAwmvW1Y7oeybLCpzQrJVuWJpS8L8Vd2TL-RTIOEVG03VA7e0_-_frNuw7MxUgVEgh8G-Nnbk_baJ6k_3w5c1SKFamFiHHDoKLFhrt1Y8JKSuGwE02V-px4Cn0dRAQAc1IN5CU6wqCrYK0p-fv_fvy28";
- 
+
 	@Test
 	public void testCheckId() throws NoSuchFieldException{
-		JWT idToken = JWTUtils.parseJWT(JWT); 		
-		OpenIdConnectResponse openIdConnectResponse= new OpenIdConnectResponse(); 
+		JWT idToken = new JWTReader().read(JWT);
+		OpenIdConnectResponse openIdConnectResponse= new OpenIdConnectResponse();
 		PrivateAccessor.setField(openIdConnectResponse, "idToken", idToken);
-		
+
 		assertTrue(openIdConnectResponse.checkId("accounts.google.com", "788732372078.apps.googleusercontent.com"));
 		assertFalse(openIdConnectResponse.checkId("wrongaccounts.google.com", "788732372078.apps.googleusercontent.com"));
 		assertFalse(openIdConnectResponse.checkId("wrongaccounts.google.com", "notexists788732372078.apps.googleusercontent.com"));



Mime
View raw message