<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – Configure clients for Kerberos authentication</title>
    <link>/en/security-and-authentication/client-authentication/kerberos-authentication/configure-clients-kerberos-authentication/</link>
    <description>Recent content in Configure clients for Kerberos authentication on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/security-and-authentication/client-authentication/kerberos-authentication/configure-clients-kerberos-authentication/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Security-and-Authentication: Configure ODBC and vsql clients on non-windows platforms</title>
      <link>/en/security-and-authentication/client-authentication/kerberos-authentication/configure-clients-kerberos-authentication/configure-odbc-and-vsql-clients-on-non-windows-platforms/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/security-and-authentication/client-authentication/kerberos-authentication/configure-clients-kerberos-authentication/configure-odbc-and-vsql-clients-on-non-windows-platforms/</guid>
      <description>
        
        
        &lt;p&gt;To configure an ODBC or vsql client on Linux or MAC OSX, you must first install the Kerberos 5 client package. See &lt;a href=&#34;../../../../../en/security-and-authentication/client-authentication/kerberos-authentication/#&#34;&gt;Kerberos authentication&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;After you install the Kerberos 5 client package, you must provide clients with a valid Kerberos configuration file (krb5.conf). To communicate with the KDC, each client participating in Kerberos authentication must have a valid, identically configured krb5.conf file. The default location for the Kerberos configuration file is /etc/krb5.conf.

&lt;div class=&#34;alert admonition tip&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Tip&lt;/h4&gt;

To enforce consistency among clients, OpenText™ Analytics Database, and the KDC, copy the /etc/krb5.conf file from the KDC to the client&#39;s/etc directory.

&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;The Kerberos configuration (&lt;code&gt;krb5.conf&lt;/code&gt;) file contains Kerberos-specific information, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;How to reach the KDC&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Default realm name&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Domain&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Path to log files&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;DNS lookup&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Encryption types to use&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ticket lifetime&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The default location for the Kerberos configuration file is &lt;code&gt;/etc/krb5.conf&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When configured properly, the client can authenticate with Kerberos and retrieve a ticket through the &lt;code&gt;kinit&lt;/code&gt; utility (see &lt;a href=&#34;#Acquire&#34;&gt;Acquire an ODBC Authentication Request and Connection&lt;/a&gt; below). Likewise, the server can then use ktutil to store its credentials in a keytab file&lt;/p&gt;
&lt;h2 id=&#34;authenticating-odbc-and-vsql-clients-requests-and-connections-on-non-windows-platforms&#34;&gt;Authenticating ODBC and vsql clients requests and connections on non-windows platforms&lt;/h2&gt;
&lt;p&gt;ODBC and vsql use the client&#39;s ticket established by &lt;code&gt;kinit&lt;/code&gt; to perform Kerberos authentication. These clients rely on the security library&#39;s default mechanisms to find the ticket file and the and Kerberos configuration file.&lt;/p&gt;
&lt;p&gt;To authenticate against Kerberos, call the &lt;code&gt;kinit&lt;/code&gt; utility to obtain a ticket from the Kerberos KDC server. The following two examples show how to send the ticket request using ODBC and vsql clients.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;Acquire&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;acquire-an-odbc-authentication-request-and-connection&#34;&gt;Acquire an ODBC authentication request and connection&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;On an ODBC client, acquire a ticket for the &lt;code&gt;kuser&lt;/code&gt; user by calling the &lt;code&gt;kinit&lt;/code&gt; utility.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ kinit kuser@EXAMPLE.COM
Password for kuser@EXAMPLE.COM:
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Connect to the database, and provide the principals in the connection string:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;char outStr[100];
SQLLEN len;
SQLDriverConnect(handle, NULL, &amp;#34;Database=VMart;User=kuser;
Server=myserver.example.com;Port=5433;KerberosHostname=vcluster.example.com&amp;#34;&lt;span class=&#34;code-input&#34;&gt;,&lt;/span&gt;
SQL_NTS, outStr, &amp;amp;len);
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;acquire-a-vsql-authentication-request-connection&#34;&gt;Acquire a vsql authentication request connection&lt;/h2&gt;
&lt;p&gt;If the vsql client is on the same machine you are connecting to, vsql connects through a UNIX domain socket. This connection bypasses Kerberos authentication. When you authenticate with Kerberos, especially if the client authentication method is configured as &#39;local&#39;, you must include the -h hostname option. See &lt;a href=&#34;../../../../../en/connecting-to/using-vsql/connecting-from-command-line/command-line-options/&#34;&gt;Command Line Options&lt;/a&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;On the vsql client, call the &lt;code&gt;kinit&lt;/code&gt; utility:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ kinit kuser@EXAMPLE.COM
Password for kuser@EXAMPLE.COM:
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Connect to the database, and provide the host and user principals in the connection string:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ ./vsql &lt;span class=&#34;code-input&#34;&gt;-K vcluster.example.com -h myserver.example.com -U kuser&lt;/span&gt;
Welcome to vsql, the Vertica Analytic Database interactive terminal.

Type:  \h or \? for help with vsql commands
\g or terminate with semicolon to execute query
\q to quit
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In the future, when you log in to vsql as &lt;code&gt;kuser&lt;/code&gt;, vsql uses your cached ticket without prompting you for a password.&lt;/p&gt;
&lt;h2 id=&#34;verify-the-authentication-method&#34;&gt;Verify the authentication method&lt;/h2&gt;
&lt;p&gt;You can verify the authentication method by querying the SESSIONS system table:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT authentication_method FROM sessions;
 authentication_method
-----------------------
GSS-Kerberos
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/connecting-to/client-libraries/client-drivers/install-config/odbc/creating-an-odbc-data-source-name-dsn/odbc-dsn-connection-properties/#&#34;&gt;ODBC DSN connection properties&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(vsql) &lt;a href=&#34;../../../../../en/connecting-to/using-vsql/connecting-from-command-line/command-line-options/#&#34;&gt;Command-line options&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Security-and-Authentication: Configure ADO.NET, ODBC, and vsql clients on Windows</title>
      <link>/en/security-and-authentication/client-authentication/kerberos-authentication/configure-clients-kerberos-authentication/configure-ado-net-odbc-and-vsql-clients-on-windows/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/security-and-authentication/client-authentication/kerberos-authentication/configure-clients-kerberos-authentication/configure-ado-net-odbc-and-vsql-clients-on-windows/</guid>
      <description>
        
        
        &lt;p&gt;The OpenText™ Analytics Database client drivers support the Windows SSPI library for Kerberos authentication. Windows Kerberos configuration is stored in the registry.&lt;/p&gt;
&lt;p&gt;You can choose between two different setup scenarios for Kerberos authentication on ODBC and vsql clients on Windows and ADO.NET:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#Windows&#34;&gt;Windows KDC on Active Directory with Windows Built-in Kerberos Client and &lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#Linux&#34;&gt;Linux KDC with Windows Built-in Kerberos Client and &lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

The procedures on this page are only relevant for &lt;a href=&#34;https://www.vertica.com/download/vertica/client-drivers/&#34;&gt;ADO.NET drivers 12.0.4 and below&lt;/a&gt;. Later versions of the ADO.NET driver do not currently support Kerberos authentication.

&lt;/div&gt;
&lt;p&gt;&lt;a name=&#34;Windows&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;windows-kdc-on-active-directory-with-windows-built-in-kerberos-client-and-the-database&#34;&gt;Windows KDC on active directory with Windows built-in Kerberos client and the database&lt;/h2&gt;
&lt;p&gt;Kerberos authentication on Windows is commonly used with Active Directory, Microsoft&#39;s enterprise directory service/Kerberos implementation.Typically your organization&#39;s network or IT administrator performs the setup.&lt;/p&gt;
&lt;p&gt;Windows clients have Kerberos authentication built into the authentication process. You do not need any additional software.&lt;/p&gt;
&lt;p&gt;Your login credentials authenticate you to the Kerberos server (KDC) when you:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Log in to Windows from a client machine&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use a Windows instance that has been configured to use Kerberos through Active Directory&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To use Kerberos authentication on Windows clients, log in as REALM\user.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
When you use the ADO.NET driver to connect to the database, you can optionally specify
&lt;code&gt;&lt;a href=&#34;../../../../../en/connecting-to/client-libraries/accessing/c/connecting-to-db/ado-net-connection-properties/#&#34;&gt;IntegratedSecurity=true&lt;/a&gt;&lt;/code&gt; in the connection string. This informs the driver to authenticate the calling user against the user&#39;s Windows credentials. As a result, you do not need to include a user name or password in the connection string. Any &lt;code&gt;user=&amp;lt;&lt;/code&gt;&lt;em&gt;&lt;code&gt;username&lt;/code&gt;&lt;/em&gt;&lt;code&gt;&amp;gt;&lt;/code&gt; entry to the connection string is ignored.
&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;Linux&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;linux-kdc-with-windows-built-in-kerberos-client-and-the-database&#34;&gt;Linux KDC with Windows built-in Kerberos client and the database&lt;/h2&gt;
&lt;p&gt;A simple, but less common scenario is to configure Windows to authenticate against a non-Windows KDC. In this implementation, you use the &lt;code&gt;ksetup&lt;/code&gt; utility to point the Windows operating system native Kerberos capabilities at a non-Active Directory KDC. By logging in to Windows, you obtain a ticket-granting ticket, similar to the Active Directory implementation. However, in this case, Windows is internally communicating with a Linux KDC. See the Microsoft Windows Server &lt;a href=&#34;http://technet.microsoft.com/en-us/library/hh240190.aspx&#34;&gt;Ksetup page&lt;/a&gt; for more information.&lt;/p&gt;
&lt;p&gt;When a database/windows user logs into their Windows machine (or after performing a kinit on Windows) the Kerberos ticket MUST have ok_as_delegate and forwardable flag set to be able to access webhdfs based external tables as follows:&lt;br /&gt;&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ CMD \&amp;gt; klist
#2&amp;gt;     Client: release @ VERT.LOCAL
Server: vertica/example.com @ VERT.LOCAL
KerbTicket Encryption Type: RSADSI RC4-HMAC(NT)
Ticket Flags 0x40a50000 forwardable renewable pre_authent ok_as_delegate name_canonicalize
Start Time: 9/27/2017 13:24:43 (local)
End Time:   9/27/2017 20:34:45 (local)
Renew Time: 10/3/2017 15:04:45 (local)
Session Key Type: RSADSI RC4-HMAC(NT)
Cache Flags: 0
Kdc Called: ADKDC01
&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

The Ticket Flags setting above must contain &lt;code&gt;ok_as_delegate&lt;/code&gt; and &lt;code&gt;forwardable&lt;/code&gt; entries. For information on these parameters see &lt;a href=&#34;https://web.mit.edu/kerberos/krb5-1.12/doc/user/user_commands/klist.html&#34;&gt;Kerberos documentation&lt;/a&gt;.

&lt;/div&gt;
&lt;h2 id=&#34;configure-windows-clients-for-kerberos-authentication&#34;&gt;Configure Windows clients for Kerberos authentication&lt;/h2&gt;
&lt;p&gt;Depending on which implementation you want to configure, refer to one of the following pages on the Microsoft Server website:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;To set up Windows clients with Active Directory, refer to &lt;a href=&#34;http://technet.microsoft.com/en-us/library/bb742433.aspx&#34;&gt;Step-by-Step Guide to Kerberos 5 (krb5 1.0) Interoperability&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To set up Windows clients with the &lt;code&gt;ksetup&lt;/code&gt; utility, refer to the &lt;a href=&#34;http://technet.microsoft.com/en-us/library/hh240190.aspx&#34;&gt;Ksetup page.&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;authenticate-and-connect-clients&#34;&gt;Authenticate and connect clients&lt;/h2&gt;
&lt;p&gt;The KDC can authenticate both an ADO.NET and a vsql client.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

Use the fully-qualified domain name as the server in your connection string; for example, use &lt;code&gt;host.example.com&lt;/code&gt; instead of just &lt;code&gt;host&lt;/code&gt;. That way, if the server moves location, you do not have to change your connection string.

&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;verify-an-adonet-authentication-request-and-connection&#34;&gt;Verify an ADO.NET authentication request and connection&lt;/h2&gt;
&lt;p&gt;This example shows how to use the &lt;code&gt;IntegratedSecurity=true&lt;/code&gt;, setting to specify that the ADO.NET driver authenticate the calling user&#39;s Windows credentials:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;VerticaConnection conn = new
VerticaConnection(&amp;#34;Database=VMart;Server=host.example.com;
Port=5433;IntegratedSecurity=true;
KerberosServiceName=vertica;KerberosHostname=vcluster.example.com&amp;#34;);
conn.open();
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;verify-a-vsql-authentication-request-and-connection&#34;&gt;Verify a vsql authentication request and connection&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Log in to your Windows client, for example, as &lt;code&gt;EXAMPLE\kuser&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the vsql client and supply the connection string to the database:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;C:\Users\kuser\Desktop&amp;gt;vsql.exe -h host.example.com -K vcluster -U kuser

Welcome to vsql, the Vertica Analytic Database interactive terminal.
Type:  \h or \? for help with vsql commands
\g or terminate with semicolon to execute query
\q to quit
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/security-and-authentication/client-authentication/kerberos-authentication/#&#34;&gt;Kerberos authentication&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/connecting-to/using-vsql/connecting-from-command-line/command-line-options/#&#34;&gt;Command-line options&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/connecting-to/client-libraries/accessing/c/connecting-to-db/ado-net-connection-properties/#&#34;&gt;ADO.NET connection properties&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Security-and-Authentication: Configure JDBC clients on all platforms</title>
      <link>/en/security-and-authentication/client-authentication/kerberos-authentication/configure-clients-kerberos-authentication/configure-jdbc-clients-on-all-platforms/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/security-and-authentication/client-authentication/kerberos-authentication/configure-clients-kerberos-authentication/configure-jdbc-clients-on-all-platforms/</guid>
      <description>
        
        
        &lt;p&gt;Kerberos authentication on JDBC clients uses Java Authentication and Authorization Service (JAAS) to acquire the initial Kerberos credentials. JAAS is an API framework that hides platform-specific authentication details and provides a consistent interface for other applications.&lt;/p&gt;
&lt;p&gt;You specify the client login process through the JAAS Login Configuration File. This file contains options that specify the authentication method and other settings to use for Kerberos. A class called the &lt;code&gt;LoginModule&lt;/code&gt; defines valid options in the configuration file.&lt;/p&gt;
&lt;p&gt;The JDBC client principal is crafted as &lt;code&gt;jdbc-username@server-from-connection-string&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;implement-the-loginmodule&#34;&gt;Implement the LoginModule&lt;/h2&gt;
&lt;p&gt;OpenText™ Analytics Database recommends that you use the JAAS public class &lt;code&gt;com.sun.security.auth.module.Krb5LoginModul&lt;/code&gt; provided in the Java Runtime Environment (JRE).&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;Krb5LoginModule&lt;/code&gt; authenticates users using Kerberos protocols and is implemented differently on non-Windows and Windows platforms:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;On non-Windows platforms:&lt;/strong&gt; The &lt;code&gt;Krb5LoginModule&lt;/code&gt; defers to a native Kerberos client implementation. Thus, you can use the same &lt;code&gt;/etc/krb5.conf&lt;/code&gt; setup as you use to &lt;a href=&#34;../../../../../en/security-and-authentication/client-authentication/kerberos-authentication/configure-clients-kerberos-authentication/configure-odbc-and-vsql-clients-on-non-windows-platforms/&#34;&gt;configure ODBC and vsql clients&lt;/a&gt; on Linux and MAC OSX platforms.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;On Windows platforms:&lt;/strong&gt; The &lt;code&gt;Krb5LoginModule&lt;/code&gt; uses a custom Kerberos client implementation bundled with the Java Runtime Environment (JRE). Windows settings are stored in a &lt;code&gt;%WINDIR%\krb5.ini&lt;/code&gt; file, which has similar syntax and conventions to the non-Windows &lt;code&gt;krb5.conf&lt;/code&gt; file. You can copy a &lt;code&gt;krb5.conf&lt;/code&gt; from a non-Windows client to &lt;code&gt;%WINDIR%\krb5.ini&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can find documentation for the &lt;code&gt;LoginModules&lt;/code&gt; in the &lt;code&gt;com.sun.security.auth&lt;/code&gt; package, and on the &lt;a href=&#34;http://docs.oracle.com/javase/7/docs/jre/api/security/jaas/spec/com/sun/security/auth/module/Krb5LoginModule.html&#34;&gt;Krb5LoginModule&lt;/a&gt; web page.&lt;/p&gt;
&lt;h2 id=&#34;create-the-jaas-login-configuration&#34;&gt;Create the JAAS login configuration&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&#34;../../../../../en/connecting-to/client-libraries/accessing/java/creating-and-configuring-connection/jdbc-connection-properties/&#34;&gt;JAASConfigName connection property &lt;/a&gt;identifies a specific configuration within a JAAS configuration that contains the &lt;code&gt;Krb5LoginModule&lt;/code&gt; and its settings. The &lt;code&gt;JAASConfigName&lt;/code&gt; setting lets multiple JDBC applications with different Kerberos settings coexist on a single host. The default configuration name is &lt;code&gt;verticajdbc&lt;/code&gt;.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
Carefully construct the JAAS login configuration file. If syntax is incorrect, authentication fails.
&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;You can configure JAAS-related settings in the &lt;code&gt;java.security&lt;/code&gt; master security properties file. This file resides in the &lt;code&gt;lib/security&lt;/code&gt; directory of the JRE. For more information, see &lt;a href=&#34;http://docs.oracle.com/javase/6/docs/technotes/guides/security/jaas/JAASRefGuide.html#AppendixA&#34;&gt;Appendix A&lt;/a&gt; in the Java&lt;sup&gt;TM&lt;/sup&gt; Authentication and Authorization Service (JAAS) Reference Guide.&lt;/p&gt;
&lt;h2 id=&#34;create-a-jdbc-login-context&#34;&gt;Create a JDBC login context&lt;/h2&gt;
&lt;p&gt;The following example shows how to create a login context for Kerberos authentication on a JDBC client. The client uses the default &lt;code&gt;JAASConfigName&lt;/code&gt; of &lt;code&gt;verticajdbc&lt;/code&gt; and specifies that:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The ticket-granting ticket will be obtained from the ticket cache&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The user will not be prompted for a password if credentials cannot be obtained from the cache, keytab file, or through a shared state.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;verticajdbc {
  com.sun.security.auth.module.Krb5LoginModule
  required
  useTicketCache=true
  doNotPrompt=true;
};
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;jdbc-authentication-request-and-connection&#34;&gt;JDBC authentication request and connection&lt;/h2&gt;
&lt;p&gt;You can configure the &lt;code&gt;Krb5LoginModule&lt;/code&gt; to use a cached ticket or keytab. The driver can also acquire a ticket or keytab automatically if the calling user provides a password.&lt;/p&gt;
&lt;p&gt;In the preceding example, the login process uses a cached ticket and does not prompt for a password because both &lt;code&gt;useTicketCache&lt;/code&gt; and &lt;code&gt;doNotPrompt&lt;/code&gt; are set to &lt;code&gt;true&lt;/code&gt;. If &lt;code&gt;doNotPrompt=false&lt;/code&gt; and you provide a user name and password during the login process, the driver provides that information to the LoginModule. The driver then calls the &lt;code&gt;kinit&lt;/code&gt; utility on your behalf.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;On a JDBC client, call the &lt;code&gt;kinit&lt;/code&gt; utility to acquire a ticket:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ kinit kuser@EXAMPLE.COM
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you prefer to use a password instead of calling the &lt;code&gt;kinit&lt;/code&gt; utility, see the next section.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Connect to Vertica:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Properties props = new Properties();
props.setProperty(&amp;#34;user&amp;#34;, &amp;#34;kuser&amp;#34;);
props.setProperty(&amp;#34;KerberosServiceName&amp;#34;, &amp;#34;vertica&amp;#34;);
props.setProperty(&amp;#34;KerberosHostName&amp;#34;, &amp;#34;vcluster.example.com&amp;#34;);
props.setProperty(&amp;#34;JAASConfigName&amp;#34;, &amp;#34;verticajdbc&amp;#34;);
Connection conn = DriverManager.getConnection
&amp;#34;jdbc:vertica://myserver.example.com:5433/VMart&amp;#34;, props);
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a name=&#34;If&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;have-the-driver-acquire-a-ticket&#34;&gt;Have the driver acquire a ticket&lt;/h2&gt;
&lt;p&gt;Sometimes, you may want to bypass calling the &lt;code&gt;kinit&lt;/code&gt; utility yourself but still use encrypted, mutual authentication. In such cases, you can optionally pass the driver a clear text password to acquire the ticket from the KDC. The password is encrypted when sent across the network. For example, &lt;code&gt;useTicketCache&lt;/code&gt; and &lt;code&gt;doNotPrompt&lt;/code&gt; are both false in the following example. Thus, the calling user&#39;s credentials are not obtained through the ticket cache or keytab.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ verticajdbc  {
  com.sun.security.auth.module.Krb5LoginModule
  required
  useTicketCache=false
  doNotPrompt=false;
};
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The preceding example demonstrates the flexibility of JAAS. The driver no longer looks for a cached ticket, and you do not have to call &lt;code&gt;kinit&lt;/code&gt;. Instead, the driver takes the password and user name and calls &lt;code&gt;kinit&lt;/code&gt; on your behalf.&lt;/p&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/security-and-authentication/client-authentication/kerberos-authentication/&#34;&gt;Kerberos Client/Server Requirements&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/connecting-to/client-libraries/accessing/java/creating-and-configuring-connection/jdbc-connection-properties/#&#34;&gt;JDBC connection properties&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;http://docs.oracle.com/javase/1.5.0/docs/guide/security/jaas/JAASRefGuide.html&#34;&gt;Java&lt;sup&gt;TM&lt;/sup&gt; Authentication and Authorization Service (JAAS) Reference Guide&lt;/a&gt; (external website)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
  </channel>
</rss>
