2015-11-04 74 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不幸的是,我不能幫助,因爲我不知道它是否可以,對不起。 –