New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is no proxy authentication #190
Comments
From yan...@google.com on January 24, 2013 06:23:40 For reference, here are the methods to set the proxy: http://javadoc.google-http-java-client.googlecode.com/hg/1.13.1-beta/com/google/api/client/http/javanet/NetHttpTransport.Builder.html#setProxy(java.net.Proxy) http://javadoc.google-http-java-client.googlecode.com/hg/1.13.1-beta/com/google/api/client/http/apache/ApacheHttpTransport.Builder.html#setProxy(org.apache.http.HttpHost) What the library lacks is a built-in way to do proxy authentication. If you have sample Java code snippets that would be really helpful. Here's what I found with a quick Google search: http://stackoverflow.com/questions/8669726/java-proxy-authentication (looks very promising if it works) http://stackoverflow.com/questions/1626549/authenticated-http-proxy-with-java (a good work-around for now) Status: Accepted |
From yan...@google.com on January 24, 2013 06:30:24 Labels: Milestone-Version2.1.0 |
From ogregoire on January 25, 2013 08:08:33 I believe you found exactly how to properly identify as the two ways you googled work properly on my behind-authenticated-proxy system. |
From yan...@google.com on February 06, 2013 15:54:01 Labels: -Milestone-Version2.1.0 Milestone-Version1.16.0 |
From yan...@google.com on June 10, 2013 06:09:11 Labels: -Milestone-Version1.16.0 Milestone-Version1.17.0 |
From yan...@google.com on July 26, 2013 03:12:18 Labels: -Milestone-Version1.17.0 Milestone-Version1.18.0 |
From yan...@google.com on September 27, 2013 04:56:43 Labels: -Milestone-Version1.18.0 |
Please follow this guide for setting proxy. closing this issue now. Please reopen if this doesn't help. |
@ajaaym please reopen. I have no permission to do so. As the original feature request says, this is about proxy authentication and not about setting proxy. The Oracle guide you linked just explains ways to set proxy. However, it does not say anything about setting up proxy authentication. However, we did find some way to set up proxy authentication by directly controlling Apache HttpClient, which Google HTTP Client depends on: GoogleContainerTools/jib#1337 and GoogleContainerTools/jib#1366 |
@chanseokoh Please look at this answer sorry I forgot to add link about this in previous comment. Please let me know if this still doesn't work. |
The accepted answer in the SO is to replace the single global |
Reopen? |
@chanseokoh this library uses Jre provided transport. Can you please describe your use case in more detail, which doesn't seems normal? This can also be achieved by using Proxy-Authroization header as described here use HttpRequestInitializer |
Thanks for opening this.
I don't think my use case is unusual. The accepted answer in the SO just can't be used in multi-thread environment. (Agreed?) I am sure you will get that a multi-thread application is a normal use case. Also, as I said, the answer affects everyone on a JVM globally, which is not acceptable if you are developing, say a plugin where your code runs on a larger framework/platform, e.g., an IDE plugin separately installable into the IDE.
I don't think this matters. IMO, the library should be able to send For example, you do have
Sure, you can do whatever you want to achieve by directly and manually crafting HTTP headers at a low level, but then there would be no point of creating an HTTP library whose purpose is to provide high-level abstraction for ease of use and convenience, if the user has to manually do tedious low-level HTTP header manipulation. For example, according to your argument, what's the point of having methods such as That said,
to set And, given that Sorry this was long, but I hope this makes things clear (for me too). |
In google-http-client 1.28.0, you will be able to actually use a modern Apache HttpClient implementation which supports proxy authentication. It will be available via google-http-client-apache (2.0.0). The ApacheHttpTransport will no longer crash with unsupported method exceptions when providing your own implementation as we removed dependence upon deprecated methods. |
@chingor13 @chanseokoh How do I use ApacheHttpTransport to configure proxy authentication? I have GMAIL service accounts and I need to build them with configured proxy authentication. |
* add App Engine API to pom.xml with test scope * remove deprecated methods * remove one more deprecated comment * 1.9.71 appngine api
I'm not sure this is relevant to this issue. But currently I experiencing issues such as "Failed to select a proxy". Isn't it possible without it? |
From ogregoire on January 11, 2013 01:56:14
Version of google-http-java-client (e.g. 1.5.0-beta)? 1.13.1-beta Java environment (e.g. Java 6, Android 2.3, App Engine)? Java 7 Describe the problem. I want my application to be able to access APIs behind a proxy that requires an authentication, but no proxy authentication is available. It is possible to set the proxy, but not to authenticate to it. How would you expect it to be fixed? Some parameters in the (Apache|Net)HttpTransport.Builder class should be set so we can use a proxy with authentication along with the proxy setting.
Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=190
The text was updated successfully, but these errors were encountered: