package dynamic.common;

import java.net.*;

public class MyAuthenticator extends Authenticator {

    // This method is called when a password-protected URL is accessed
    protected PasswordAuthentication getPasswordAuthentication() {

//        // Get information about the request
//        System.out.println(getRequestingPrompt());
//        System.out.println(getRequestingHost());
//        System.out.println(getRequestingSite());
//        System.out.println(getRequestingPort());
//        System.out.println(getRequestingProtocol());
//        System.out.println(getRequestingScheme());
//        System.out.println(getRequestingURL());
//        System.out.println(getRequestorType());

        // Return the information
        return new PasswordAuthentication(LoginHandler.username, LoginHandler.password.toCharArray());
    }

}
