use of org.apache.flink.runtime.security.modules.JaasModuleFactory in project flink by apache.
the class TestingSecurityContext method install.
public static void install(SecurityConfiguration config, Map<String, ClientSecurityConfiguration> clientSecurityConfigurationMap) throws Exception {
SecurityUtils.install(config);
// install dynamic JAAS entries
for (String factoryClassName : config.getSecurityModuleFactories()) {
SecurityModuleFactory factory = SecurityFactoryServiceLoader.findModuleFactory(factoryClassName);
if (factory instanceof JaasModuleFactory) {
DynamicConfiguration jaasConf = (DynamicConfiguration) javax.security.auth.login.Configuration.getConfiguration();
for (Map.Entry<String, ClientSecurityConfiguration> e : clientSecurityConfigurationMap.entrySet()) {
AppConfigurationEntry entry = KerberosUtils.keytabEntry(e.getValue().getKeytab(), e.getValue().getPrincipal());
jaasConf.addAppConfigurationEntry(e.getKey(), entry);
}
break;
}
}
}
Aggregations