Advertisement
aiste

Untitled

Jun 15th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1.         byte[] encodedPasw = Base64.getEncoder().encode("tavo passw".getBytes());
  2.         final String authUser = "aisteb";
  3.         final String authPassword = new String(encodedPasw);
  4.  
  5.         Authenticator.setDefault(
  6.                 new Authenticator() {
  7.                     @Override
  8.                     public PasswordAuthentication getPasswordAuthentication() {
  9.                         return new PasswordAuthentication(
  10.                                 authUser, authPassword.toCharArray());
  11.                     }
  12.                 }
  13.         );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement