Java provides a super simple, yet hidden from plain view, way to do basic authentication of HttpURLConnection / URLConnection. Before making a connection add the following lines of code: final String login =”…”; final String password =”…”; Authenticator.setDefault(new Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication (login, password.toCharArray()); [...]
Java provides a super simple, yet hidden from plain view, way to do basic authentication of HttpURLConnection / URLConnection.
Before making a connection add the following lines of code:
final String login =”…”; final String password =”…”;
Authenticator.setDefault(new Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication (login, password.toCharArray()); [...]
Please fill in the following fields
* - Required
Your Name: *
Your E-Mail: *
Your Remarks:
Friend's Name: *
Friend's E-Mail: *