org.springframework.security.kerberos.client.KerberosRestTemplate Java Examples

The following examples show how to use org.springframework.security.kerberos.client.KerberosRestTemplate. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LivyTaskSubmitHelper.java    From griffin with Apache License 2.0 6 votes vote down vote up
public void deleteByLivy(String uri) {
    LOGGER.info("Delete by Livy URI is: " + uri);
    String needKerberos = env.getProperty("livy.need.kerberos");
    LOGGER.info("Need Kerberos:" + needKerberos);

    if (needKerberos == null || needKerberos.isEmpty()) {
        LOGGER.error("The property \"livy.need.kerberos\" is empty");
        return;
    }

    if (needKerberos.equalsIgnoreCase("false")) {
        LOGGER.info("The livy server doesn't need Kerberos Authentication");
        new RestTemplate().delete(uri);
    } else {
        LOGGER.info("The livy server needs Kerberos Authentication");
        String userPrincipal = env.getProperty("livy.server.auth.kerberos.principal");
        String keyTabLocation = env.getProperty("livy.server.auth.kerberos.keytab");
        LOGGER.info("principal:{}, lcoation:{}", userPrincipal, keyTabLocation);

        KerberosRestTemplate restTemplate = new KerberosRestTemplate(keyTabLocation, userPrincipal);
        restTemplate.delete(uri);
    }
}
 
Example #2
Source File: KerberosConfig.java    From Hacktoberfest2019 with Apache License 2.0 4 votes vote down vote up
@Bean
public RestTemplate restTemplate() {
    return new KerberosRestTemplate(keytabLocation, principal);
}
 
Example #3
Source File: RestTemplateConfig.java    From metron with Apache License 2.0 4 votes vote down vote up
protected KerberosRestTemplate getKerberosRestTemplate(String keyTabLocation, String userPrincipal) {
    return new KerberosRestTemplate(keyTabLocation, userPrincipal);
}
 
Example #4
Source File: KerberosConfig.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
public RestTemplate restTemplate() {
	return new KerberosRestTemplate(keytabLocation, principal);
}