Class HttpAuthenticator


  • public class HttpAuthenticator
    extends Authenticator
    Handle network authentication.

    When we try to access a protected site, getPasswordAuthentication() is called by the network connection code (HttpURLConnection in our case) to obtain any credentials (username and password) required to access the site.

    Note: This only occurs until we successfully "log in" - after that, we are not invoked again for the site in question.

    • Constructor Detail

      • HttpAuthenticator

        public HttpAuthenticator()
    • Method Detail

      • setCredentials

        public void setCredentials​(String realm,
                                   String username,
                                   String password)
        Establish realm login credentials
        Parameters:
        realm - Realm for authentication (ADS)
        username - User for login
        password - Password