You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (JIRA)" <ji...@apache.org> on 2018/04/29 21:05:00 UTC
[jira] [Commented] (WAGON-309) NTLM for webdav behind IIS
[ https://issues.apache.org/jira/browse/WAGON-309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16458196#comment-16458196 ]
Michael Osipov commented on WAGON-309:
--------------------------------------
Is this one still valid?
> NTLM for webdav behind IIS
> --------------------------
>
> Key: WAGON-309
> URL: https://issues.apache.org/jira/browse/WAGON-309
> Project: Maven Wagon
> Issue Type: Improvement
> Components: wagon-webdav
> Affects Versions: 1.0-beta-2
> Environment: client: jdk1.5
> server: iis 6, tomcat 5.5 and ssl
> Reporter: Alessandro Gerlinger Romero
> Priority: Minor
> Fix For: waiting-for-feedback
>
> Attachments: wagon-webdav.zip, wagon-webdav.zip
>
>
> To use webdav over https with IIS 6, I changed two files to use NTCredentials. It is compatible with basic authentication.
> -------
> WebDavWagon.java
> -------
> try
> {
> httpURL = urlToHttpURL( url );
> /* - begin - before
> if ( hasAuthentication )
> {
> String userName = authenticationInfo.getUserName();
> String password = authenticationInfo.getPassword();
> if ( userName != null && password != null )
> {
> //httpURL.setUserinfo( userName, password );
> webdavResource.setCredentials( new NTCredentials(userName, password, "saows1701.accenture.com", "saows1701") );
> }
> }
> - end - before
> */
> CorrectedWebdavResource.setDefaultAction( CorrectedWebdavResource.NOACTION );
> webdavResource = new CorrectedWebdavResource( httpURL );
> // begin - after
> if ( hasAuthentication )
> {
> String userName = authenticationInfo.getUserName();
> String password = authenticationInfo.getPassword();
> if ( userName != null && password != null )
> {
> //httpURL.setUserinfo( userName, password );
> webdavResource.setCredentials( new NTCredentials(userName, password, repository.getHost(), repository.getHost()) );
> }
> }
> // end - after
> -----------
> CorrectedWebdavResource.java
> -----------
> /**
> * FOWARD NTCREDENTIALS FOR EACH TRANSACTION
> * It is compatible with basic authentication.
> *
> * @see org.apache.webdav.lib.WebdavResource#generateTransactionHeader(org.apache.commons.httpclient.HttpMethod)
> */
> protected void generateTransactionHeader(HttpMethod method) {
> WebdavState state = (WebdavState) client.getState();
> String host = null;
> String realm = null;
> if ( hostCredentials instanceof NTCredentials){
> host = ((NTCredentials)hostCredentials).getHost();
> realm = ((NTCredentials)hostCredentials).getDomain();
> }
> state.setCredentials(realm, host, hostCredentials);
> super.generateTransactionHeader(method);
> }
> *******
> LIMITATIONS
> *******
> Uses host as realm.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)