|Basic Scheme Authentication||Under the Hood|
|Java 1.1||Learning More|
|Digest Scheme Authentication||Links|
In Java version 1.2 or later, 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 with
import 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 into the server. See the File I/O amanuensis or the CMP HTTP package for how. The technique reputedly works for HTTP (Hypertext Transfer Protocol) and proxies. It may work for HTTPS (Hypertext Transfer Protocol over SSL (Secure Socket Layer)). It even works for digest passwords. I don’t see how it could work for certificate style authentication, however, but who knows…
If you are using an older Java, you will have to do it the Smith-Barney way (obscure reference to the late John Houseman):
For the more secure digest-style authentication, the protocol is more complex. It requires nine subfields. It
is described in RFC 2617. Java Authenticator uses this method when the server specifies scheme=
digest. It works by sending an MD5 digest with each transaction, and changing the digest periodically. Your Applet does not need to get involved with the details of how it works. Authenticator handles it all transparently. You can fine tune how it works with networking properties:
Sun does does not have a method to tell you which schemes Authenticator supports or what the official scheme names are. It may support others besides basic, digest, ntlm and spnego (Kerberos). It does not work with cookies or forms.
You might wonder how after the login is complete that the server can tell if messages coming in from the Internet are from people who are already logged in. There are a number of ways of doing it. Some you might think would work don’t.
available on the web at:
optional Replicator mirror
Please email your feedback for publication, letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : . If you want your message, your name or email kept confidential, not considered for public posting, please explicitly specify that. Unless you state otherwise, I will treat your message as a letter to the editor that I may or may not publish in the feedback section. After that, it will be too late to retract it. If you disagree with something I said, especially when sending an ad-hominem attack, a rant composed mainly of obscenities or a death threat, please quote the offending passage and cite the web page where you found it, tell me why you think it is wrong, and, if possible, provide some supporting evidence. I can’t very well fix erroneous or ambiguous text if I can’t find it.
Your face IP:[126.96.36.199]
|Feedback||You are visitor number 34,573.|