Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- byte[] encodedPasw = Base64.getEncoder().encode("tavo passw".getBytes());
- final String authUser = "aisteb";
- final String authPassword = new String(encodedPasw);
- Authenticator.setDefault(
- new Authenticator() {
- @Override
- public PasswordAuthentication getPasswordAuthentication() {
- return new PasswordAuthentication(
- authUser, authPassword.toCharArray());
- }
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement