Created
July 16, 2011 13:41
-
-
Save ikikko/1086366 to your computer and use it in GitHub Desktop.
Basic authentication Script for Script Security Realm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def url = 'http://example.com/' | |
Authenticator.default = { | |
[ | |
// user | |
System.env.U, | |
// password | |
System.env.P.toCharArray() | |
] | |
} as Authenticator | |
// authentication by accessing to basic authentication url | |
try { | |
new URL(url).text | |
} catch (e) { | |
System.exit(1) | |
} | |
System.exit(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment