Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8128203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:48:12+00:00 2026-06-06T07:48:12+00:00

So I’m trying to track down a strange bug with NTLMv2 and Java. It

  • 0

So I’m trying to track down a strange bug with NTLMv2 and Java. It seems like NTLM is ignoring any information I pass in during the Java based authentication, and finds the information somewhere else. Because of this, NTLM will authenticate on my machine, even if I provide the incorrect information, and won’t work on any other machine even when the correct information is provided. The endpoint is the MOSS 2007 webservice API if that’s relevant.

Here’s the process I’m using to authenticate:

1) Pass in the target site and login info.

try {
    JLists list = new JLists(siteUrl, DEFAULT_SP_USERNAME,
        DEFAULT_SP_PASSWORD);
    list.addList(name, description, 101);

} catch (Exception e) {
     e.printStackTrace();
}

2) Set the default authenticator to my own NTLMAuthenticator,
create the service stub and pass in the login info.

public JLists(String siteURI, String username, String password)
        throws Exception {

    String endpointURI = siteURI + "/_vti_bin/Lists.asmx";

    Authenticator.setDefault(new NtlmAuthenticator(username, password));

    port = sharePointListsAuth(username, password);
    BindingProvider bp = (BindingProvider) port;
    bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
            endpointURI);
}

private ListsSoap sharePointListsAuth(String userName, String password) throws Exception {
    ListsSoap port = null;
    if (userName != null && password != null) {
        try {
            service = new Lists();
            port = service.getListsSoap();
            ((BindingProvider) port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, userName);
            ((BindingProvider) port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
        } catch (Exception e) {
            throw new Exception("Error: " + e.toString());
        }
    } else {
        throw new Exception("Couldn't authenticate: Invalid connection details given.");
    }
    return port;
}

Here’s a copy of the NTLMAuthenticator class as well:

import java.net.Authenticator;
import java.net.PasswordAuthentication;

class NtlmAuthenticator extends Authenticator {

  private final String username;
  private final char[] password;

  public NtlmAuthenticator(final String username, final String password) {
    super();
    this.username = username;
    this.password = password.toCharArray(); 
  }

  public PasswordAuthentication getPasswordAuthentication() {
    return (new PasswordAuthentication (username, password));
  }
}

3) Make my service call. I’m not really having any problems in this part, but if someone needs the code I’ll post it as well.

I feel like Java is somehow referencing my Active Directory information, and using that instead the information provided, but I have no idea at what point that would happen.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:48:13+00:00Added an answer on June 6, 2026 at 7:48 am

    It seems like the problem is based around Java’s “Single Sign-On” functionality. Because I am attempting NTLM authentication on Windows machine, Java has a hard-coded value that defaults to the login information of the current account, then uses the Java Authenticator only if that fails.

    Seems there is no way to bypass this without decompiling the Java source and modifying that variable yourself, but thankfully that wont be needed in the end case for my application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.