Kerberos authentication
- Last Updated: March 19, 2024
- 4 minute read
- DataDirect Connectors
- JDBC
- Documentation
Your Kerberos environment should be fully configured before you configure the driver for Kerberos authentication. You should refer to your Impala and Java documentation for instructions on configuring Kerberos. For a Windows Active Directory implementation, you should also consult your Windows documentation. For a non-Active Directory implementation (on a Windows or non-Windows operating system), you should consult MIT Kerberos documentation.
Important: A properly configured Kerberos environment must include a means
of obtaining a Kerberos Ticket Granting Ticket (TGT). For a Windows Active Directory
implementation, Active Directory automatically obtains the TGT. However, for a
non-Active Directory implementation, the means of obtaining the TGT must be
automated or handled manually.
Once your Kerberos environment has been configured, take the following steps to configure the driver.
For example, the following is a connection URL with the
required and optional properties for making a connection using Kerberos
authentication.
Connection URL:
Connection conn = DriverManager.getConnection
("jdbc:datadirect:impala://myserver:21050;AuthenticationMethod=kerberos;
DatabaseName=ImpalaDB;ImpersonateUser=user2;
ServicePrincipalName=impala/myserver@EXAMPLE.COM;");Data Source:
ImpalaDataSource mds = new ImpalaDataSource();
mds.setDescription("My Impala Data Source");
mds.setServerName("server_name");
mds.setPort("port");
mds.setAuthenticationMethod("kerberos");
mds.setDatabaseName("testDB");
mds.setImpersonateUser("user2");
mds.setServicePrincipleName("impala/myserver@EXAMPLE.COM");