title: Unable to deploy artifact using encrypted password with LDAP enabled
body: <p>We are using Artifactory Version 4.7.0. I have configured LDAP for Artifactory and i am able to login successfully. When i am trying to use encrypted password for deploying artifacts, it's not working. In Artifacts tab, i clicked on "Set Me Up" and generated Maven settings after entering my credentials. I then downloaded the settings.xml file which had the following content:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
    &lt;servers&gt;
      &lt;server&gt;
        &lt;username&gt;${security.getCurrentUsername()}&lt;/username&gt;
        &lt;password&gt;${security.getEscapedEncryptedPassword()!"*** Insert encrypted password here ***"}&lt;/password&gt;
        &lt;id&gt;central&lt;/id&gt;
      &lt;/server&gt;
      &lt;server&gt;
        &lt;username&gt;${security.getCurrentUsername()}&lt;/username&gt;
        &lt;password&gt;${security.getEscapedEncryptedPassword()!"*** Insert encrypted password here ***"}&lt;/password&gt;
        &lt;id&gt;snapshots&lt;/id&gt;
      &lt;/server&gt;
    &lt;/servers&gt;
    &lt;profiles&gt;
      &lt;profile&gt;
        &lt;repositories&gt;
          &lt;repository&gt;
            &lt;snapshots&gt;
              &lt;enabled&gt;false&lt;/enabled&gt;
            &lt;/snapshots&gt;
            &lt;id&gt;central&lt;/id&gt;
            &lt;name&gt;libs-release&lt;/name&gt;
            &lt;url&gt;http://artifactory:9090/libs-release&lt;/url&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
            &lt;snapshots /&gt;
            &lt;id&gt;snapshots&lt;/id&gt;
            &lt;name&gt;libs-snapshot&lt;/name&gt;
            &lt;url&gt;http://artifactory:9090/libs-snapshot&lt;/url&gt;
          &lt;/repository&gt;
        &lt;/repositories&gt;
        &lt;pluginRepositories&gt;
          &lt;pluginRepository&gt;
            &lt;snapshots&gt;
              &lt;enabled&gt;false&lt;/enabled&gt;
            &lt;/snapshots&gt;
            &lt;id&gt;central&lt;/id&gt;
            &lt;name&gt;plugins-release&lt;/name&gt;
            &lt;url&gt;http://artifactory:9090/plugins-release&lt;/url&gt;
          &lt;/pluginRepository&gt;
          &lt;pluginRepository&gt;
            &lt;snapshots /&gt;
            &lt;id&gt;snapshots&lt;/id&gt;
            &lt;name&gt;plugins-snapshot&lt;/name&gt;
            &lt;url&gt;http://artifactory:9090/plugins-snapshot&lt;/url&gt;
          &lt;/pluginRepository&gt;
        &lt;/pluginRepositories&gt;
        &lt;id&gt;artifactory&lt;/id&gt;
      &lt;/profile&gt;
    &lt;/profiles&gt;
    &lt;activeProfiles&gt;
      &lt;activeProfile&gt;artifactory&lt;/activeProfile&gt;
    &lt;/activeProfiles&gt;
  &lt;/settings&gt;
  </code></pre>
  
  <p>Then i went to my profile, entered password and copied the Encrypted Password as shown below:</p>
  
  <p><a href="https://i.stack.imgur.com/9f2KO.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9f2KO.png" alt="enter image description here"></a></p>
  
  <p>I copied this password in my settings.xml as shown below:</p>
  
  <pre><code>    &lt;server&gt;
        &lt;username&gt;${security.getCurrentUsername()}&lt;/username&gt;
        &lt;password&gt;${security.getEscapedEncryptedPassword()!"AP6FcvsVawZhcfEdZB2PCTrCUZa"}&lt;/password&gt;
        &lt;id&gt;central&lt;/id&gt;
      &lt;/server&gt;
      &lt;server&gt;
        &lt;username&gt;${security.getCurrentUsername()}&lt;/username&gt;  
        &lt;password&gt;${security.getEscapedEncryptedPassword()!"AP6FcvsVawZhcfEdZB2PCTrCUZa"}&lt;/password&gt;
        &lt;id&gt;snapshots&lt;/id&gt;
      &lt;/server&gt;
  </code></pre>
  
  <p>and then when i tried deploying an artifact, i get the following error:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project more-maven-examples: Failed to deploy artifac
  ts: Could not transfer artifact com.infiniteskills.maven:more-maven-examples:jar:1.0 from/to central (http://artifactory:9090/libs-release-local):
  Failed to transfer file: http://artifactory:9090/libs-release-local/com/infiniteskills/maven/more-maven-examples/1.0/more-maven-examples-1.0.jar. R
  eturn code is: 401, ReasonPhrase: Unauthorized. -&gt; [Help 1]
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  </code></pre>
  
  <p>Entry in <em>request.log</em> file for the failed attempt:</p>
  
  <pre><code>20160525143037|9526|REQUEST|10.20.55.124|non_authenticated_user|PUT|/libs-release-local/com/infiniteskills/maven/more-maven-examples/1.0/more-maven-examples-1.0.jar|HTTP/1.1|401|2981
  20160525143037|2|REQUEST|10.20.55.124|non_authenticated_user|PUT|/libs-release-local/com/infiniteskills/maven/more-maven-examples/1.0/more-maven-examples-1.0.pom|HTTP/1.1|401|1235
  </code></pre>
  
  <p>In Security > General > Password Encryption Policy is set to SUPPORTED. Also, Passwords Encryption is set to encrypted.</p>
  
  <p>Surprisingly, when i <em>hard-code</em> my name and LDAP password in the settings.xml file in the same <code>&lt;server&gt;</code> block, it works fine.</p>
  
  <p>Am i doing something wrong or is it a bug?</p>