| Basic Scheme Authentication | Under the Hood |
| JDK 1.1- | Learning More |
| Digest Scheme Authentication | Links |
In Java 1.2+, in your client code, you can use the java.net.Authenticator class to handle the details. You extend the class overriding the getPasswordAuthentication method like this:
Then you then register your custom Authenticator withimport java.net.Authenticator; //... // hooking up your custom Authenticator Authenticator.setDefault( new MyAuthenticator() );You then do your GETs ignoring logons! Your Authenticator magically kicks in when needed and logs you in to the server. See the File I/O amanuensis or the CMP HTTP package for how. The technique reputedly works for HTTP and proxies. It may work for HTTPS. It even works for digest passwords. I don’t see how it could work for certificate style authentication, however, but who knows…
Sun does not document which schemes Authenticator supports. It may support others besides basic, digest and ntlm. It does not work with cookies.
| You can get the freshest copy of this page from: | or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror) | |
| http://mindprod.com/jgloss/authentication.html | J:\mindprod\jgloss\authentication.html | |
![]() | ||
| Canadian Mind Products | ||
| mindprod.com IP:[65.110.21.43] | ||
| view Blog | Your face IP:[38.107.191.105] | |
| Feedback | You are visitor number 22,897. | |