lib 1013814 // google http client lib 1013815 // google api client lib 1013816 // google oauth client lib 1013817 // jackson lib 1013818 // google jackson2 lib 1013819 // google http client appengine //lib 1013820 // appengine api sdk import com.google.api.client.googleapis.auth.oauth2.GoogleIdToken; import com.google.api.client.googleapis.auth.oauth2.GoogleIdToken.Payload; import com.google.api.client.googleapis.auth.oauth2.GoogleIdTokenVerifier; import com.google.api.client.json.jackson2.JacksonFactory; //import com.google.api.client.extensions.appengine.http.UrlFetchTransport; import com.google.api.client.http.javanet.NetHttpTransport; static bool googleVerifyUserToken(S clientID, S token) ctex { //UrlFetchTransport.getDefaultInstance(); new NetHttpTransport transport; GoogleIdTokenVerifier verifier = new GoogleIdTokenVerifier.Builder(transport, new JacksonFactory) // Specify the CLIENT_ID of the app that accesses the backend: .setAudience(Collections.singletonList(clientID)) .build(); GoogleIdToken idToken = verifier.verify(token); if (idToken != null) { Payload payload = idToken.getPayload(); // Print user identifier String userId = payload.getSubject(); print("User ID: " + userId); // Get profile information from payload String email = payload.getEmail(); boolean emailVerified = Boolean.valueOf(payload.getEmailVerified()); String name = (String) payload.get("name"); String pictureUrl = (String) payload.get("picture"); String locale = (String) payload.get("locale"); String familyName = (String) payload.get("family_name"); String givenName = (String) payload.get("given_name"); print("Name: " + name); true; } else { print("Invalid ID token."); false; } }