2015-11-04 73 views
0

Java无法在我自己的密钥表文件中找到我的主体名称?
我期待Java JAAS模块在我的keytab文件中找到主体时生成TGT。我还在同一个keytab文件上使用了kinit,并且确实有效。Java 1.8 JAAS无法识别我自己生成的密钥表中的主体

虽然JAAS发现通过配置文件指示密钥表,我得到一个消息:

... 
Native config name: C:\Windows\krb5.ini 
getRealmFromDNS: trying YEF.GSC.RD 
Acquire TGT from Cache 
>>>KinitOptions cache name is C:\Users\tester1\krb5cc_tester1 
>> Acquire default native Credentials 
Using builtin default etypes for default_tkt_enctypes 
default etypes for default_tkt_enctypes: 17 16 23. 
LSA: Found KrbCreds constructor 
LSA: Got handle to Kerberos package 
LSA: Response size is 0 
LSA: Error calling function Protocol status: 1312 
LSA: A specified logon session does not exist. It may already have been terminated. 
>>> Found no TGT's in LSA 
Principal is [email protected] 
null credentials from Ticket Cache 
Looking for keys for: [email protected] 
Key for the principal [email protected] not available in c:/user/tester1/keytab 

(我用的是调试标志-Dsun.security.krb5.debug =真得到这些详细信息,并运行它独立位置,而不是在webstart,只是得到的东西开始,而不在webstart启动开销)
配置文件中说:

WEBSTART_CLIENT_CONTEXT { 
     com.sun.security.auth.module.Krb5LoginModule required 
     useTicketCache=true 
     doNotPrompt=false 
     principal=john 
     renewTGT=true 
     useKeyTab=true 
     keyTab="c:/user/tester1/keytab" 
     debug=true; 
    }; 

密钥表文件,该文件I基因额定本地客户机上是:

c:\Users\tester1>klist -k -t -K -e keytab 

Key tab: keytab, 6 entries found. 

[1] Service principal: [email protected] 
     KVNO: 1 
     Key type: 17 
     Key: 0x2dccdcd29d17e2719eb5af9f1b0f7448 
     Time stamp: Oct 30, 2015 15:37:02 
[2] Service principal: [email protected] 
     KVNO: 1 
     Key type: 16 
     Key: 0xcd10890becd5fbcb526e9104765116807a5ecd38da762ab0 
     Time stamp: Oct 30, 2015 15:37:02 
[3] Service principal: [email protected] 
     KVNO: 1 
     Key type: 23 
     Key: 0xb9218bada80f02c685e1958a5042f5fc 
     Time stamp: Oct 30, 2015 15:37:02 
[4] Service principal: [email protected] 
     KVNO: 1 
     Key type: 17 
     Key: 0x7d4b7a98e179d7284dcd7ff3a69c890e 
     Time stamp: Nov 02, 2015 13:24:37 
[5] Service principal: [email protected] 
     KVNO: 1 
     Key type: 16 
     Key: 0x4ca17a0b2a58679207162cf13864c143d05e869101b5a2ef 
     Time stamp: Nov 02, 2015 13:24:37 
[6] Service principal: [email protected] 
     KVNO: 1 
     Key type: 23 
     Key: 0xb9218bada80f02c685e1958a5042f5fc 
     Time stamp: Nov 02, 2015 13:24:37 

但出于某种原因JAAS找不到[email protected],因为它说:

主要用于主要约翰@ YEF。 GSC.RD在C不可用:/用户/ tester1 /密钥表

互联网上有人提到KVNO是0,所以我还测试了使用:

ktab -k keytab -a [email protected] -n 0

但是发生了完全相同的错误。想知道什么是Java的预计,在密钥表找到..

Windows 7计算机

+0

FYI还有另外一个调试标志,如果你甚至不进入,因为跛脚配置的KRB库:'为-Djava.security.debug = configfile,gssloginconfig,configparser,logincontext' –

回答

0

您的问题是最有可能涉及到path错误使用Java 1.8.0。在你的配置中,你使用路径keyTab="c:/user/tester1/keytab",当你使用klist工具检查它时,你使用另一条路径c:\Users\tester1>

您的配置应该指向正确的路径。给予,这不是一个错字,应该是:

keyTab="c:/Users/tester1/keytab" 
+0

我的天啊。谢谢! – Houtman

+0

现在,这工作..有没有办法让JAAS将生成的TGT和SessionKey存储在krb5cc_tester1缓存文件中?我还没有在Krb5LoginModule中找到这个标志。 – Houtman

+0

@Houtman不幸的是,我不能帮助,因为我不知道它是否可以,对不起。 –