We wrote a client to create a user on googleapps using the GoogleNetHttpTransport, but we are getting a socketTimeoutException when making the user as Super Admin through superadmin api. Connecting User has superAdmin Privileges itself.
How to increase the ReadTimeOut/SocketTimeout when we are using the GoogleNetHttpTransport. Please find below code snippent on connecting to target and making the client
httpTransport = GoogleNetHttpTransport.newTrustedTransport() ;
GoogleCredential credential = new GoogleCredential.Builder()
.setTransport(httpTransport)
.setJsonFactory(JSON_FACTORY)
.setServiceAccountId(serviceAccountId)
.setServiceAccountScopes(scopes)
.setServiceAccountUser(superAdminUserMail)
.setServiceAccountPrivateKeyFromP12File(privateKeyFile).build();
client = new Directory.Builder(httpTransport, JSON_FACTORY,credential)
.setApplicationName(APPLICATION_NAME).
.setHttpRequestInitializer(credential).build();
//Getting the sockt/timeout exception
client.users().makeAdmin(userID, admin).execute();