1

I'm very confused on how this is supposed to work. I've tried using something like this:

    con = (HttpURLConnection) url2.openConnection();
    con.setReadTimeout(10000);
    con.setInstanceFollowRedirects(true);
    con.setAllowUserInteraction(true);
    con.setDoOutput(true);
    con.setDoInput(true);
        Authenticator.setDefault(new MyAuthenticator());
    con.connect();


class MyAuthenticator extends Authenticator {

      protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication("myUser", "MyPassword".toCharArray());
      }
    }

I'm getting a 401 error returned by this method so obviously I'm missing the point. According to this chart NTLMv2 should be supported in JRE 6. My confusion lies in the fact that this is running on Android. In the stack trace from the exception thrown by getOutputStream I see an Apache implementation of HttpURLConnection being referenced.

From what I have found in my research Apache is unable to include NTLMv2 protocols due to licensing issues. Is this why it does not work on android?

Either way I'd like to know how this would be done in Java, not just Android.

1 Answer 1

1

It is not implemented. Check out this issue: http://code.google.com/p/android/issues/detail?id=4962. Also consider the fact that Android is not JRE 6, it is a modified version of standard Java.

Sign up to request clarification or add additional context in comments.

1 Comment

It's actually possible using the JCIFS library: csharpening.net/blog/?p=271

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.