[ 
http://jira.codehaus.org/browse/MNG-4792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=257442#action_257442
 ] 

Tarjei Skorgenes edited comment on MNG-4792 at 2/23/11 8:14 AM:
----------------------------------------------------------------

Having hit the same problem as you I've come to the conclusion that there are 
multiple layers of problems here that hinders preemptive authentication from 
working:

1) The configuration listed in [1] is never injected into the 
HttpMethodConfiguration-objects created by Plexus during configuration of 
HttpWagon. This is caused by the fact that the params-field in 
HttpMethodConfiguration is of type Properties and PropertiesConverter does not 
recognize the param-element. Replacing param with property fixes this part of 
the problem:
{code:xml}
<configuration>
  <wagonProvider>httpclient</wagonProvider>
  <httpConfiguration>
    <put>
      <params>
        <property>
          <name>http.authentication.preemptive</name>
          <value>%b,true</value>
        </property>
      </params>
    </put>
  </httpConfiguration>
</configuration>
{code}
2) Once properly configured Http Client ignores the preemptive-parameter 
completely. This is caused by the fact that the check for preemptive 
authentication in HTTP Client's HttpMethodDirector (line 158) is not performed 
on the PutMethod-object. The check is done one the HttpClientParams-object and 
this one has not been configured by HttpWagon to include any information about 
preemptive-auth.

      was (Author: lothor):
    Having hit the same problem as you I've come to the conclusion that there 
are multiple layers of problems here that hinders preemptive authentication 
from working:

1) The configuration listed in [1] is never injected into the 
HttpMethodConfiguration-objects created by Plexus during configuration of 
HttpWagon. This is caused by the fact that the params-field in 
HttpMethodConfiguration is of type Properties and PropertiesConverter does not 
recognize the param-element. Replacing param with property fixes this part of 
the problem:
{code:xml}
<configuration><wagonProvider>httpclient</wagonProvider><httpConfiguration><put><params><property><name>http.authentication.preemptive</name><value>%b,true</value></property></params></put></httpConfiguration></configuration>
{code}
2) Once properly configured Http Client ignores the preemptive-parameter 
completely. This is caused by the fact that the check for preemptive 
authentication in HTTP Client's HttpMethodDirector (line 158) is not performed 
on the PutMethod-object. The check is done one the HttpClientParams-object and 
this one has not been configured by HttpWagon to include any information about 
preemptive-auth.
  
> Preemptive authentication doesn't work
> --------------------------------------
>
>                 Key: MNG-4792
>                 URL: http://jira.codehaus.org/browse/MNG-4792
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Artifacts and Repositories
>    Affects Versions: 2.2.1
>         Environment: Sun Java 1.6.0_21, Windows 7
>            Reporter: Marcin Zajaczkowski
>
> It seems preemptive authentication in Maven using httpclient wagon provider 
> doesn't work. With configuration taken form [1] Maven knock to repository 
> (tested with Artifactory 2.2.5) as anonymous user.
> <server>
>  <id>repo-id</id>
>  <username>user</username>
>  <password>pass</password>
>  <configuration>
>   <wagonProvider>httpclient</wagonProvider>
>   <httpConfiguration>
>    <put>
>     <params>
>      <param>
>       <name>http.authentication.preemptive</name>
>       <value>%b,true</value>
>      </param>
>     </params>
>    </put>
>   </httpConfiguration>
>  </configuration>
> </server>
> Confirmed by independent party also with Maven 2.2.1. I can sniff http 
> traffic if needed.
> [1] - http://maven.apache.org/guides/mini/guide-http-settings.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to