I am using JSOUP for crawling on pages that are behind Kerberos. In JSoup I have to hardcode my ID and Password to gain access to the webpage and read the contents. I want to know a way by which I don’t have to hardcode the credentials but rather (somehow) redirect it to the user’s screen asking for login details. Here is the code I currently have.
String login = username + ":" + password;
final String base64login = new String(Base64.encodeBase64(login.getBytes()));
Document doc = Jsoup.connect(url).timeout(0).header("Authorization", "Basic " + base64login).get();