SHARE
TWEET

Untitled

a guest Aug 20th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jdbc:impala://XXXXXXX:21050/impala?AuthMech=1;KrbRealm=AAA.BBB.CC;KrbHostFQDN=my-proxy;KrbServiceName=impala;LogLevel=6;LogPath=/tmp/
  2.      
  3. <security>
  4.       <security-domain>security-impala</security-domain>
  5. </security>
  6.      
  7. <security-domain name="security-impala" cache-type="default">
  8.  
  9.    <authentication>
  10.  
  11.      <login-module code="org.jboss.security.negotiation.KerberosLoginModule" flag="required" module="org.jboss.security.negotiation">
  12.  
  13.        <module-option name="useKeyTab" value="true"/>
  14.        <module-option name="keyTab" value="/path/to/my.keytab"/>
  15.        <module-option name="principal" value="principal@REALM.COM"/>
  16.        <module-option name="useTicketCache" value="false"/>
  17.        <module-option name="debug" value="true"/>
  18.        <module-option name="refreshKrb5Config" value="true"/>
  19.        <module-option name="isInitiator" value="true"/>
  20.        <module-option name="doNotPrompt" value="true"/>
  21.  
  22.      </login-module>
  23.  
  24.    </authentication>
  25.  
  26. </security-domain>
  27.      
  28. UserGroupInformation ugi =
  29. UserGroupInformation.loginUserFromKeytabAndReturnUGI(user, keytabfile);
  30. Connection con = (Connection) ugi.doAs(new
  31. PrivilegedExceptionAction<Object>() {
  32.       public Object run() {
  33.         Connection tcon = null;
  34.         try {
  35.           tcon = DriverManager.getConnection(connectionURL, user,
  36. passwd);
  37.         } catch (SQLException e) {}
  38.         return tcon;
  39.       }
  40. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top