spring security - How to use cached ticket with KerberosRestTemplate? -
i want implement integration test spring security kerberos authentication. there kerberosresttemplate (reference) purpose. kerberosresttemplate has got default constructor description "leave keytablocation , userprincipal empty if want use cached ticket".
for research wrote trivial class:
public static void main(string[] args) { kerberosresttemplate krt = new kerberosresttemplate(); string result = krt.getforobject("http://testserver.testad.local:8080/", string.class); system.out.println(result); }
when run it, exception has thrown:
exception in thread "main" org.springframework.web.client.restclientexception: error running rest call; nested exception java.lang.illegalargumentexception: null name not allowed @ org.springframework.security.kerberos.client.kerberosresttemplate.doexecute(kerberosrestt emplate.java:196) @ org.springframework.web.client.resttemplate.execute(resttemplate.java:530) @ org.springframework.web.client.resttemplate.getforobject(resttemplate.java:237) @ edu.mezlogo.application.main(application.java:9) caused by: java.lang.illegalargumentexception: null name not allowed @ sun.security.krb5.principalname.<init>(unknown source) @ sun.security.krb5.principalname.<init>(unknown source) @ javax.security.auth.kerberos.kerberosprincipal.<init>(unknown source) @ javax.security.auth.kerberos.kerberosprincipal.<init>(unknown source) @ org.springframework.security.kerberos.client.kerberosresttemplate.doexecute(kerberosrestt emplate.java:182) ... 3 more
my klist contain correct cached ticket, service.
#2> client: deniz @ testad.local server: http/testserver.testad.local @ testad.local kerbticket encryption type: rsadsi rc4-hmac(nt) ticket flags 0x40a10000 -> forwardable renewable pre_authent name_canonicalize start time: 2/5/2016 6:17:39 (local) end time: 2/5/2016 16:16:32 (local) renew time: 2/12/2016 6:16:32 (local) session key type: rsadsi rc4-hmac(nt)
and browser (firefox) has successful authenticated kerberos sso.
i use windows server 2012. , windows 7 client.
how use cached ticket? (and ktpass can generate client keytab?)
p.s. sorry english.
you checking windows credentials cache - while java maintaining it's separate. in order view java's credentials cache should execute klist
command jre/bin
folder
Comments
Post a Comment