Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Security
Expertise: Beginner
May 2, 1999

Network Authentication

Question:
The new java.net.Authenticator class in JDK 1.2 seems to be the answer to generalized user-authentication. Why do getPasswordAuthentication and requestPasswordAuthentication both return PasswordAuthentication, but requestPasswordAuthentication requires a security check?

Answer:
The getPasswordAuthentication method is a protected member function. It is overridden by a subclass to implement the actual user name and password retrieval. The requestPasswordAuthentication method is a static method that performs a SecurityManager check before calling getPasswordAuthentication() using the currently registered Authenticator. Applications should use requestPasswordAuthentication, whereas authentication implementors should subclass Authenticator and implement getPasswordAuthentication().

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date