title: How to configure spark thrift user and password
body: <p>i am trying to connect spark thrift server by beeline, and i started spark thrift as below:</p>
  
  <pre><code>start-thriftserver.sh --master yarn-client --num-executors 2 --conf spark.driver.memory=2g --executor-memory 3g
  </code></pre>
  
  <p>and the spark conf/hive-site.xml as below:</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;property&gt;
          &lt;name&gt;javax.jdo.option.ConnectionURL&lt;/name&gt;
          &lt;value&gt;jdbc:node001:3306/hive?useSSL=false&lt;/value&gt;
      &lt;/property&gt;
      &lt;property&gt;
          &lt;name&gt;javax.jdo.option.ConnectionDriverName&lt;/name&gt;
          &lt;value&gt;com.mysql.jdbc.Driver&lt;/value&gt;
      &lt;/property&gt;
      &lt;property&gt;
          &lt;name&gt;hive.server2.authentication&lt;/name&gt;
          &lt;value&gt;NONE&lt;/value&gt;
      &lt;/property&gt;
      &lt;property&gt;
          &lt;name&gt;hive.server2.thrift.client.user&lt;/name&gt;
          &lt;value&gt;root&lt;/value&gt;
      &lt;/property&gt;
      &lt;property&gt;
          &lt;name&gt;hive.server2.thrift.client.password&lt;/name&gt;
          &lt;value&gt;123456&lt;/value&gt;
      &lt;/property&gt;
      &lt;property&gt;
          &lt;name&gt;hive.server2.thrift.port&lt;/name&gt;
          &lt;value&gt;10001&lt;/value&gt;
      &lt;/property&gt;
      &lt;property&gt;
          &lt;name&gt;hive.security.authorization.enabled&lt;/name&gt;
          &lt;value&gt;true&lt;/value&gt;
          &lt;description&gt;enableor disable the hive clientauthorization&lt;/description&gt;         
      &lt;/property&gt;
      &lt;property&gt;
          &lt;name&gt;javax.jdo.option.ConnectionUserName&lt;/name&gt;
          &lt;value&gt;hive&lt;/value&gt;
      &lt;/property&gt;            
      &lt;property&gt;
          &lt;name&gt;javax.jdo.option.ConnectionPassword&lt;/name&gt;
          &lt;value&gt;123456&lt;/value&gt;
      &lt;/property&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>when i use beeline cli to access spark thrift server, it hint me input username and passwd, but i didn't input anything, just click enter(no input the username and password configured in hive-site.xml), i also can access spark. How can make the configuration work well.</p>
  
  <p>Thanks :)</p>
  
  <pre><code>beeline&gt; !connect jdbc:hive2://node001:10001
  Connecting to jdbc:hive2://node001:10001
  Enter username for jdbc:hive2://node001:10001: 
  Enter password for jdbc:hive2://node001:10001: 
  18/12/06 16:13:44 INFO Utils: Supplied authorities: node001:10001
  18/12/06 16:13:44 INFO Utils: Resolved authority: node001:10001
  18/12/06 16:13:45 INFO HiveConnection: Will try to open client transport with JDBC Uri: jdbc:hive2://node001:10001
  Connected to: Spark SQL (version 2.4.0)
  Driver: Hive JDBC (version 1.2.1.spark2)
  Transaction isolation: TRANSACTION_REPEATABLE_READ
  0: jdbc:hive2://node001:10001&gt; show databases;
  +-------------------------+--+
  |      databaseName       |
  +-------------------------+--             |
  | default                 |
  | test                    |
  +-------------------------+--+
  7 rows selected (0.142 seconds)
  0: jdbc:hive2://node001:10001&gt;
  </code></pre>