title: How to configure the authentication in spring data with mongodb (Spring-config.xml)
body: <p>How to configure the authentication in  spring data with mongodb (Spring-config.xml)</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mongo="http://www.springframework.org/schema/data/mongo"
  xsi:schemaLocation="http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo.xsd
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"&gt;
  
      &lt;mongo:mongo-client credentials="admin:admin@admin" /&gt;
  
      &lt;bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"&gt;
          &lt;constructor-arg ref="mongo" /&gt;
          &lt;constructor-arg name="databaseName" value="itsadmin" /&gt;
      &lt;/bean&gt;
  &lt;/beans&gt; 
  </code></pre>
  
  <p>Here this is my spring-config.xml but i am getting issues</p>