Skip to content

Instantly share code, notes, and snippets.

@jesseeichar
Created August 15, 2012 06:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesseeichar/3356853 to your computer and use it in GitHub Desktop.
Save jesseeichar/3356853 to your computer and use it in GitHub Desktop.
Authentication in Scala-IO
val username = "myusername"
val password = "mypassword".toCharArray()
class MyAuthenticator extends Authenticator {
def getPasswordAuthentication =
new PasswordAuthentication(kuser, password);
}
Authenticator.setDefault(new MyAuthenticator());
println(Resource.fromURL(args(0)).string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment