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
Post a Comment