jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x Javadoc Plugin
  • MJAVADOC-270

NTLM Authentication doesn't seem to work

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 2.6
  • Fix Version/s: None
  • Labels:
    None

Description

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<additionalJOption>-J-Dhttp.auth.ntlm.domain=MIP-LONDON</additionalJOption>
</configuration>
</plugin>

Stack Trace:
---------------

[INFO] Generating "JavaDocs" report.
[WARNING] Source files encoding has not been set, using platform encoding ISO-8859-1, i.e. build is platform dependent!
Oct 21, 2009 1:55:22 PM org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme
INFO: ntlm authentication scheme selected
Oct 21, 2009 1:55:22 PM org.apache.commons.httpclient.HttpMethodDirector authenticate
SEVERE: Credentials cannot be used for NTLM authentication: org.apache.commons.httpclient.UsernamePasswordCredentials
org.apache.commons.httpclient.auth.InvalidCredentialsException: Credentials cannot be used for NTLM authentication: org.apache.commons.httpclient.UsernamePasswordCredentials
at org.apache.commons.httpclient.auth.NTLMScheme.authenticate(NTLMScheme.java:332)
at org.apache.commons.httpclient.HttpMethodDirector.authenticateProxy(HttpMethodDirector.java:320)
at org.apache.commons.httpclient.HttpMethodDirector.authenticate(HttpMethodDirector.java:232)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
at org.apache.maven.plugin.javadoc.JavadocUtil.fetchURL(JavadocUtil.java:773)
at org.apache.maven.plugin.javadoc.AbstractJavadocMojo.isValidJavadocLink(AbstractJavadocMojo.java:4680)
at org.apache.maven.plugin.javadoc.AbstractJavadocMojo.addLinkArguments(AbstractJavadocMojo.java:3229)
at org.apache.maven.plugin.javadoc.AbstractJavadocMojo.addStandardDocletOptions(AbstractJavadocMojo.java:3885)
at org.apache.maven.plugin.javadoc.AbstractJavadocMojo.executeReport(AbstractJavadocMojo.java:1761)
at org.apache.maven.plugin.javadoc.JavadocReport.generate(JavadocReport.java:122)
at org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:139)
at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:269)
at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:101)
at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:133)
at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:100)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Oct 21, 2009 1:55:22 PM org.apache.commons.httpclient.HttpMethodDirector processProxyAuthChallenge
INFO: Failure authenticating with NTLM <any realm>@prx:80
[ERROR] Error fetching link: http://java.sun.com/j2se/1.5.0/docs/api/package-list. Ignored it.

Issue Links

relates to

Bug - A problem which impairs or prevents the functions of the product. MJAVADOC-253 Http proxy does not work any more

  • Critical - Crashes, loss of data, severe memory leak.
  • Open - The issue is open and ready for the assignee to start work on it.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Trevor Scroggins added a comment - 04/Mar/10 6:46 PM - edited

NTLM authentication in org.apache.commons.httpclient requires an instance of org.apache.commons.httpclient.NTCredentials rather than org.apache.commons.httpclient.UsernamePasswordCredentials. Something like this may work in JavadocUtil.fetchURL():

if ( StringUtils.isNotEmpty( activeProxy.getUsername() ) && activeProxy.getPassword() != null )
{
    if ( /* NTLM host */ != null && /* NTLM domain */ != null )
    {
        Credentials nTLMCredentials =
            new NTCredentials( activeProxy.getUsername(), activeProxy.getPassword(),
                               /* NTLM host */, /* NTLM domain */ );
        AuthScope authScope =
            new AuthScope( null, -1, null, "NTLM" );

        httpClient.getState().setProxyCedentials( authScope, nTLMCredentials );
    }

    Credentials anyCredentials =
        new UsernamePasswordCredentials( activeProxy.getUsername(), activeProxy.getPassword() );

    httpClient.getState().setProxyCredentials( AuthScope.ANY, anyCredentials );
}

The "NTLM host" and "NTLM domain" settings would need to be intregrated with org.apache.maven.settings.Proxy and the command-line mangling methods supporting Javadoc.

org.apache.commons.httpclient.HttpAuthenticator.selectAuthScheme() prefers NTLM over digest and basic authentication. Proxies that support more than one method of authentication, e.g. NTLM and digest, will fail authentication using the current JavadocUtil implementation.

Show
Trevor Scroggins added a comment - 04/Mar/10 6:46 PM - edited NTLM authentication in org.apache.commons.httpclient requires an instance of org.apache.commons.httpclient.NTCredentials rather than org.apache.commons.httpclient.UsernamePasswordCredentials. Something like this may work in JavadocUtil.fetchURL():
if ( StringUtils.isNotEmpty( activeProxy.getUsername() ) && activeProxy.getPassword() != null )
{
    if ( /* NTLM host */ != null && /* NTLM domain */ != null )
    {
        Credentials nTLMCredentials =
            new NTCredentials( activeProxy.getUsername(), activeProxy.getPassword(),
                               /* NTLM host */, /* NTLM domain */ );
        AuthScope authScope =
            new AuthScope( null, -1, null, "NTLM" );

        httpClient.getState().setProxyCedentials( authScope, nTLMCredentials );
    }

    Credentials anyCredentials =
        new UsernamePasswordCredentials( activeProxy.getUsername(), activeProxy.getPassword() );

    httpClient.getState().setProxyCredentials( AuthScope.ANY, anyCredentials );
}
The "NTLM host" and "NTLM domain" settings would need to be intregrated with org.apache.maven.settings.Proxy and the command-line mangling methods supporting Javadoc. org.apache.commons.httpclient.HttpAuthenticator.selectAuthScheme() prefers NTLM over digest and basic authentication. Proxies that support more than one method of authentication, e.g. NTLM and digest, will fail authentication using the current JavadocUtil implementation.
Hide
Permalink
Trevor Scroggins added a comment - 04/Mar/10 6:52 PM

Linking to critical issue MJAVADOC-253.

Show
Trevor Scroggins added a comment - 04/Mar/10 6:52 PM Linking to critical issue MJAVADOC-253.
Hide
Permalink
Martijn Verburg added a comment - 09/Dec/10 9:41 AM

Affects version should include 2.7 as well.

Show
Martijn Verburg added a comment - 09/Dec/10 9:41 AM Affects version should include 2.7 as well.

People

  • Assignee:
    Unassigned
    Reporter:
    Martijn Verburg
Vote (4)
Watch (5)

Dates

  • Created:
    21/Oct/09 7:59 AM
    Updated:
    09/Dec/10 9:41 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.