Hi Adam
Thanx for your support.
This is the detail of my process : I have
1- A jsp for login that contains this form
<form action="
https://accounts.google.com/o/oauth2/auth" method="get" name="loginForm">
<input type="hidden" name="response_type" value="token id_token" />
<input type="hidden" name="client_id" value="
xxxxxx.apps.googleusercontent.com" />
<input type="hidden" name="redirect_uri" value="
http://xxxxxxxx.appspot.com/xxxx.jsp" />
<input type="hidden" name="scope" value="openid email" />
<input type="hidden" name="access_type" value="online" />
<input type="hidden" name="approval_prompt" value="auto" />
<input type="hidden" name="openid.realm" value="
http://xxxxxxxxx.appspot.com/" />
</form>
When we submit the form above I receive the response that contains the id_token in the page xxxx.jsp
2- In the page xxxxx.jsp I use this function below to retrieve the email
public String getEmailFromURL(String idToken){
System.out.println(idToken);
String[] jwtParts = idToken.split("\\.");
String payload = "";
JSONObject json = null;
payload = new String( Base64.decode(jwtParts[1].getBytes()));
System.out.println(payload);
//
logger.info("Payload: "+payload);
//json = (JSONObject) JSONValue.parse(payload);\
String email = getEmail(payload);
if(payload!=null)
System.out.println(email);
//
logger.info("Email: "+json.get("email"));
return email;
}
Remember that its worked very well since April 2016, but on October 22, 2016 Its not working, because the id_token is invalid. The statement "System.out.println(payload);" that's print the payload with an ? in the console of the cloud.
Best Regards.