spring-projects / spring-security-kerberos

Spring Security Kerberos
https://spring.io/projects/spring-security-kerberos
182 stars 226 forks source link

Use External Kerberos Principal #120

Open rmkellogg opened 6 years ago

rmkellogg commented 6 years ago

The existing KerberosRestTemplate supports passing the principal and keytab location. If you want to do a kinit command prior to use of the KerberosRestTemplate, it is possible to pass a null value for the principal and keytab.

The only change required is to guard against a null userPrincipal in the KerberosRestTemplate.doExecute method. If this is missing the GSSAPI API will check for an existing principal outside of explicit loginConfig.