    All Examples  All Security Examples

# package examples.security.proxy

##

- GUIProxyAuthenticator

# about this example

This example is a graphical interface that implements the weblogic.common.proxyAuthenticator interface. An implementation of this interface is required to allow an application to provide user authentication information when tunneling WebLogic HTTP and SSL protocols through a proxy server that requires user authentication.

The GUIProxyAuthenticator class prompts for the user name and password for the proxy server and returns the values entered, or `null` if the cancel button is clicked.

# how to use this example

To test the example, you need a running proxy server and a running WebLogic Server. For each of these servers you need the name of the computer, and the port the server is listening on. You can use the the weblogic.T3Admin utility's ping command as a test for your connections.

1. Set up your development environment, as describe in Setting your development environment. Compile GUIProxyAuthenticator.java with a command like this one for Windows NT:

         $ javac -d %CLIENT_CLASSES% *.java

2. Test the https protocol tunnelled through the proxy server:

         $ java -Dhttps.proxyHost=proxyHost -Dhttps.proxyPort=proxyPort \
           -Dweblogic.net.proxyAuthenticatorClassName=\
           examples.security.proxy.GUIProxyAuthenticator \
           weblogic.T3Admin https://WebLogicHost:WebLogicSSLPort/ PING 10 10

   proxyHost
     The name of the computer running the proxy server.
   proxyPort
     The port number where the proxy server is running on the proxyHost.
   WebLogicHost
     The name of the computer running the WebLogic Server.
   WebLogicSSLPort
     The port number where the WebLogic Server listens for SSL connections.

3. Test the t3s protocol tunnelled through the proxy server:

        $ java -Dssl.proxyHost=proxyHost -Dssl.proxyPort=proxyPort \
           -Dweblogic.net.proxyAuthenticatorClassName=\
           examples.security.proxy.GUIProxyAuthenticator \
           weblogic.T3Admin t3s://WebLogicHost:WebLogicSSLPort/ PING 10 10

   proxyHost
     The name of the computer running the proxy server.
   proxyPort
     The port number where the proxy server is running on the proxyHost.
   WebLogicHost
     The name of the computer running the WebLogic Server.
   WebLogicSSLPort
     The port number the WebLogic Server listens on for SSL connections.

4. Test the http protocol tunnelled through the proxy server:

        $ java -Dhttp.proxyHost=proxyHost -Dhttp.proxyPort=proxyPort \
           -Dweblogic.net.proxyAuthenticatorClassName=\
           examples.security.proxy.GUIProxyAuthenticator \
           weblogic.T3Admin http://WebLogicHost:WebLogicPort/ PING 10 10

   proxyHost
     The name of the computer running the proxy server.
   proxyPort
     The port number where the proxy server is running on the proxyHost.
   WebLogicHost
     The name of the computer running the WebLogic Server.
   WebLogicPort
     The port number where the WebLogic Server is listening.

# there's more . . .

Read more about tunnelling in Writing a client application. Read about WebLogic SSL in Using WebLogic SSL.