Closed olivierdagenais closed 8 years ago
I was able to add two positive tests (they assert that the proxy server was indeed used) and I couldn't get a negative test going (configures the proxy, but turns it off, which should cause requests to fail), maybe because the JavaFX browser decides to try connecting directly if the proxy server isn't responding.
Summary
Without these changes, a program using this component would open a web browser that would not follow the same proxy server configuration as the program and thus would be unable to complete the OAuth 2.0 Authorization Code Flow when access to the authorization endpoint needed to be performed through a proxy server. This is because oauth2-useragent uses sub-processes to launch web browsers and the network-related configuration of the parent process was not propagated to the child processes.
This pull request propagates the values of networking-related system properties to the sub-processes such that if the main program can reach resources through a proxy server, so will the web browsers used for OAuth 2.0 flows.
Manual testing
192.168.0.117
. It's listening on all interfaces at port8123
.For each of Windows 10, Mac OS X 10.10.5 and Fedora 22:
-Ddebug=true
.003 Router
option and then renewing the lease.wget
yieldsNetwork is unreachable
orNo route to host
.insecureStore.xml
toinsecureStore.xml.old
.git clone
against a Git repo in the VSTS account.Configure Git to use our proxy server by running:
Try the
git clone
again....which means it's unable to reach VSTS and so Git falls back to prompting for credentials.
Update the
credential.helper
configuration to include the following:git clone
again.server has reponded
and the web browser is popped up to complete the authentication. :white_check_mark:git clone
succeeding.Windows & Linux (Oracle documents this setting as only being available "[on] recent Windows systems and on Gnome 2.x systems")
Update the
credential.helper
configuration to replace the twohttps.proxy*
properties with the following:git fetch
inside the local copy of the Git repository.http.proxy
configuration.Mission accomplished!