title: How to validate username and password against wso2 esb Primary User Store
body: <p>I am working with wso2esb 4.8.1. I wish to authenticate my client against wso2 esb Primary user store with Plain text password.So i have done below changes and its working fine.
  I have commented the <strong>PasswordDigest</strong> element.</p>
  
  <pre><code>&lt;UserStoreManager class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager"&gt;
              &lt;Property name="TenantManager"&gt;org.wso2.carbon.user.core.tenant.JDBCTenantManager&lt;/Property&gt;
          &lt;Property name="ReadOnly"&gt;false&lt;/Property&gt;
              &lt;Property name="MaxUserNameListLength"&gt;100&lt;/Property&gt;
              &lt;Property name="IsEmailUserName"&gt;false&lt;/Property&gt;
              &lt;Property name="DomainCalculation"&gt;default&lt;/Property&gt;
             &lt;!-- &lt;Property name="PasswordDigest"&gt;SHA-256&lt;/Property&gt; --&gt;
              &lt;Property name="StoreSaltedPassword"&gt;true&lt;/Property&gt;
              &lt;Property name="ReadGroups"&gt;true&lt;/Property&gt;
          &lt;Property name="WriteGroups"&gt;true&lt;/Property&gt;
              &lt;Property name="UserNameUniqueAcrossTenants"&gt;false&lt;/Property&gt;
              &lt;Property name="PasswordJavaRegEx"&gt;^[\S]{5,30}$&lt;/Property&gt;
              &lt;Property name="PasswordJavaScriptRegEx"&gt;^[\S]{5,30}$&lt;/Property&gt;
          &lt;Property name="UsernameJavaRegEx"&gt;^[^~!#$;%^*+={}\\|\\\\&amp;lt;&amp;gt;,\'\"]{3,30}$&lt;/Property&gt;
          &lt;Property name="UsernameJavaScriptRegEx"&gt;^[\S]{3,30}$&lt;/Property&gt;
          &lt;Property name="RolenameJavaRegEx"&gt;^[^~!#$;%^*+={}\\|\\\\&amp;lt;&amp;gt;,\'\"]{3,30}$&lt;/Property&gt;
          &lt;Property name="RolenameJavaScriptRegEx"&gt;^[\S]{3,30}$&lt;/Property&gt;
              &lt;Property name="UserRolesCacheEnabled"&gt;true&lt;/Property&gt;
              &lt;Property name="MaxRoleNameListLength"&gt;100&lt;/Property&gt;
              &lt;Property name="MaxUserNameListLength"&gt;100&lt;/Property&gt;
          &lt;Property name="SharedGroupEnabled"&gt;false&lt;/Property&gt;
              &lt;Property name="SCIMEnabled"&gt;false&lt;/Property&gt;
          &lt;/UserStoreManager&gt;
  </code></pre>
  
  <p>and wrote the proxy like this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;proxy xmlns="http://ws.apache.org/ns/synapse" name="authent" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"&gt;
      &lt;target&gt;
          &lt;inSequence&gt;
              &lt;property name="username" value="admin" scope="default" type="STRING"/&gt;
              &lt;property name="password" value="admin" scope="default" type="STRING"/&gt;
              &lt;dblookup&gt;
                  &lt;connection&gt;
                      &lt;pool&gt;
                          &lt;dsName&gt;jdbc/WSO2CarbonDB&lt;/dsName&gt;
                      &lt;/pool&gt;
                  &lt;/connection&gt;
                  &lt;statement&gt;
                      &lt;sql&gt;select  UM_USER_NAME  from UM_USER where UM_USER_NAME=? and UM_USER_PASSWORD= ?&lt;/sql&gt;
                      &lt;parameter value="faisal" type="CHAR"/&gt;
                      &lt;parameter value="faisal" type="CHAR"/&gt;
                      &lt;result name="IsUserExisted" column="UM_USER_NAME"/&gt;
                  &lt;/statement&gt;
              &lt;/dblookup&gt;
              &lt;log level="full"&gt;
                  &lt;property name="IsUserExisted" expression="get-property('IsUserExisted')"/&gt;
              &lt;/log&gt;
          &lt;/inSequence&gt;
          &lt;outSequence/&gt;
      &lt;/target&gt;
      &lt;description/&gt;
  &lt;/proxy&gt;
  </code></pre>
  
  <p>I created <strong>faisal</strong> user in my console. So its working fine.
  whenever my offset is 0 that time its working fine.If i change the offset its not working.
  Its returning null.
  Basically i wish to use this query as my username and password validation.</p>
  
  <p>So please let me know what is the issue.</p>
  
  <p>Thanks in Advance.</p>