title: What are the advantages of using authentication alias in data sources?
body: <p>When I add a data source that contain the <code>user</code> and <code>password</code> properties in the <code>server.xml</code> in <a href="https://developer.ibm.com/wasdev/websphere-liberty/" rel="nofollow">WebSphere Liberty</a> </p>
  
  <p>Example:</p>
  
  <pre><code>&lt;dataSource jdbcDriverRef="db2-driver" type="javax.sql.DataSource"&gt;
    &lt;properties.db2.jcc user="MyUser" password="MyPassword"
                  databaseName="dbName" serverName="localhost" portNumber="50000"/&gt;
  &lt;/dataSource&gt;
  </code></pre>
  
  <p>I get the following warning in the logs:</p>
  
  <pre><code>J2CA8050I: An authentication alias should be used instead of defining a user name 
             and password on dataSource[default-0].
  </code></pre>
  
  <p>Looking at how to do this in <a href="https://www-01.ibm.com/support/knowledgecenter/was_beta_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/twlp_sec_jca.html" rel="nofollow">Configuring authentication aliases for the Liberty profile</a> I see them put the <code>user</code> and <code>password</code> in another element called <code>authData</code> like this:</p>
  
  <pre><code>&lt;authData id="auth1" user="MyUser" password="MyPassword"/&gt;
  </code></pre>
  
  <p>I don't get what advantage moving the user name and password from the <code>dataSource</code> element to the <code>authData</code> element is giving me. In both cases the password is showing in plain text in the <code>server.xml</code> file.</p>