google api - GoogleApp Directory API's to set the Proxy credentials -


i using googleapps directory api access googleapps. have 1 query regarding proxy , how set proxy credentials using directory api's.

as per googleapps api's documentation can use class "googlenethttptransport" set proxy (port , host).

static httptransport newproxytransport() throws generalsecurityexception, ioexception { nethttptransport.builder builder = new nethttptransport.builder(); builder.trustcertificates(googleutils.getcertificatetruststore()); builder.setproxy(new proxy(proxy.type.http, new inetsocketaddress("127.0.0.1", 3128))); return builder.build(); }

but if have credentials proxy server how can set, there no mention setting proxy credentials.

is there googleapps api allow set proxy credentials along hostname , port?

if no , should go setdefault(authenticator) set proxy credentials system property ?

can have idea this. input on highly appreciable!

you may refer documentation. http proxy java client library, if corporate proxy server running on my.proxy.domain.com, on port 3128, add following code before creating service object google calendar, google spreadsheets, etc.

system.setproperty("http.proxyhost", "my.proxy.domain.com"); system.setproperty("http.proxyport", "3128"); 

alternatively, can done on command line when starting servlet environment:

java -dhttp.proxyhost=my.proxy.domain.com -dhttp.proxyport=3128 

you may refer related thread: google directory api using service account via proxy


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -