oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1813303 - /oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/TokenController.java
Date Wed, 25 Oct 2017 14:41:12 GMT
Author: asanso
Date: Wed Oct 25 14:41:12 2017
New Revision: 1813303

URL: http://svn.apache.org/viewvc?rev=1813303&view=rev
Log:
OLTU-205 - JSON token response incorrect, google token has a unexpected format

Modified:
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/TokenController.java

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=1813303&r1=1813302&r2=1813303&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 Oct 25 14:41:12 2017
@@ -99,13 +99,15 @@ public class TokenController {
             if (Utils.GOOGLE.equalsIgnoreCase(app)) {
                 OpenIdConnectResponse openIdConnectResponse = ((OpenIdConnectResponse) oauthResponse);
                 JWT idToken = openIdConnectResponse.getIdToken();
-                oauthParams.setIdToken(idToken.getRawString());
+                if (idToken != null) {
+                    oauthParams.setIdToken(idToken.getRawString());
 
-                oauthParams.setHeader(new JWTHeaderWriter().write(idToken.getHeader()));
-                oauthParams.setClaimsSet(new JWTClaimsSetWriter().write(idToken.getClaimsSet()));
+                    oauthParams.setHeader(new JWTHeaderWriter().write(idToken.getHeader()));
+                    oauthParams.setClaimsSet(new JWTClaimsSetWriter().write(idToken.getClaimsSet()));
 
-                URI uri = URI.create(oauthParams.getTokenEndpoint());
-                oauthParams.setIdTokenValid(openIdConnectResponse.checkId(uri.getHost(),
oauthParams.getClientId()));
+                    URI uri = URI.create(oauthParams.getTokenEndpoint());
+                    oauthParams.setIdTokenValid(openIdConnectResponse.checkId(uri.getHost(),
oauthParams.getClientId()));
+                }
             }
 
             return new ModelAndView("get_resource");



Mime
View raw message