Popular Posts
LogonUser Function : impersonate a windows user // This sample demonstrates the use of the WindowsIdentity class to impersonate a user. // IMPORTANT NOTES:  // This sample can be run only ... JSRequest, Get parameters from querystring with javascript in SharePoint Provides method to parse query string, filename, and pathname from URL // Initialize first JSRequest.EnsureSetup(); // Get the current fil... Enable edit option in Shutter in Linux sudo apt-get install libgoo-canvas-perl Reference: How To Fix Disabled Edit Option In Shutter in Linux Mint
Stats
Sending Basic authentication using URL
URL url = new URL(“location address”);
URLConnection conn = url.openConnection();
String authorizationString = "Basic" + Base64.encode("username:password");
conn.setRequestProperty ("Authorization", authorizationString);
InputStream in = conn.getInputStream();
OR
Authenticator.setDefault (new Authenticator() {
    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication ("username", "password".toCharArray());
    }
});