org.springframework.security.kerberos.authentication.KerberosTicketValidator Java Examples

The following examples show how to use org.springframework.security.kerberos.authentication.KerberosTicketValidator. 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: KerberosTicketValidatorFactory.java    From nifi-registry with Apache License 2.0 6 votes vote down vote up
@Bean
public KerberosTicketValidator kerberosTicketValidator() throws Exception {

    if (kerberosTicketValidator == null && properties.isKerberosSpnegoSupportEnabled()) {

        // Configure SunJaasKerberos (global)
        final File krb5ConfigFile = properties.getKerberosConfigurationFile();
        if (krb5ConfigFile != null) {
            final GlobalSunJaasKerberosConfig krb5Config = new GlobalSunJaasKerberosConfig();
            krb5Config.setKrbConfLocation(krb5ConfigFile.getAbsolutePath());
            krb5Config.afterPropertiesSet();
        }

        // Create ticket validator to inject into KerberosServiceAuthenticationProvider
        SunJaasKerberosTicketValidator ticketValidator = new SunJaasKerberosTicketValidator();
        ticketValidator.setServicePrincipal(properties.getKerberosSpnegoPrincipal());
        ticketValidator.setKeyTabLocation(new FileSystemResource(properties.getKerberosSpnegoKeytabLocation()));
        ticketValidator.afterPropertiesSet();

        kerberosTicketValidator = ticketValidator;

    }

    return kerberosTicketValidator;

}
 
Example #2
Source File: KerberosServiceFactoryBean.java    From localization_nifi with Apache License 2.0 5 votes vote down vote up
private KerberosTicketValidator createTicketValidator() throws Exception {
    SunJaasKerberosTicketValidator ticketValidator = new SunJaasKerberosTicketValidator();
    ticketValidator.setServicePrincipal(properties.getKerberosSpnegoPrincipal());
    ticketValidator.setKeyTabLocation(new FileSystemResource(properties.getKerberosSpnegoKeytabLocation()));
    ticketValidator.afterPropertiesSet();
    return ticketValidator;
}
 
Example #3
Source File: KerberosServiceFactoryBean.java    From nifi with Apache License 2.0 5 votes vote down vote up
private KerberosTicketValidator createTicketValidator() throws Exception {
    SunJaasKerberosTicketValidator ticketValidator = new SunJaasKerberosTicketValidator();
    ticketValidator.setServicePrincipal(properties.getKerberosSpnegoPrincipal());
    ticketValidator.setKeyTabLocation(new FileSystemResource(properties.getKerberosSpnegoKeytabLocation()));
    ticketValidator.afterPropertiesSet();
    return ticketValidator;
}
 
Example #4
Source File: SecureKerberosIT.java    From nifi-registry with Apache License 2.0 4 votes vote down vote up
@Primary
@Bean
public static KerberosTicketValidator kerberosTicketValidator() {
    return new MockKerberosTicketValidator();
}