Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,18 @@ public AppConfigurationEntry[] getAppConfigurationEntry(String name)
options.put("debug", "true");
}
if (config.getKeytab() != null) {
options.put("storeKey", "true");
options.put("useKeyTab", "true");
options.put("keyTab", config.getKeytab().getAbsolutePath());
}

if (config.getKeyCache() != null) {
options.put("useTicketCache", "true");
options.put("renewTGT", "true");
options.put("ticketCache", config.getKeyCache().getAbsolutePath());
}
options.put("isInitiator", "false");
options.put("useKeyTab", "true");
options.put("principal", servicePrincipal);
options.put("storeKey", "true");

return new AppConfigurationEntry[] {new AppConfigurationEntry(Krb5LoginModule.class.getName(), REQUIRED, options)};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
public class KerberosConfig
{
public static final String HTTP_SERVER_AUTHENTICATION_KRB5_KEYTAB = "http-server.authentication.krb5.keytab";
public static final String HTTP_SERVER_AUTHENTICATION_KRB5_KEYCACHE = "http-server.authentication.krb5.keycache";

private File kerberosConfig;
private String serviceName;
private File keytab;
private File keyCache;
private String principalHostname;
private KerberosNameType nameType = HOSTBASED_SERVICE;
private Optional<String> userMappingPattern = Optional.empty();
Expand Down Expand Up @@ -79,6 +81,19 @@ public KerberosConfig setKeytab(File keytab)
return this;
}

@FileExists
public File getKeyCache()
{
return keyCache;
}

@Config("http-server.authentication.krb5.keycache")
public KerberosConfig setKeyCache(File keyCache)
{
this.keyCache = keyCache;
return this;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we apply some sort of a validation here so that we could either keyTab or credentialCache but not both, like how we do in hive connector.

public String getPrincipalHostname()
{
return principalHostname;
Expand Down