2016-12-20 38 views
1

KerberosよりもビルドインSPNEGO認証を使用してTomcat 7.0.69用にWebSSOを設定しようとしています。アプリケーションにアクセスすると、HTTP BasicAuthダイアログがポップアップし、デバッグエントリがcatalina.outに書き込まれます(下記参照)。Tomcat Kerberos Spnego認可が動作しない

マイkeytabファイルsso.keytabは(ktpass.exeを& SETSPN.EXEを経由して)私のAD-サーバーに登録された元本が含まれています。

私は、Kerberosのデバッグモードをオンにしましたが、問題は見つかりませんでした。それは単にログアウトを入力すると停止する。認証が停止し、その理由が何であるか、あなたは何か考えていますか?どんな助けもありがとう!

catalina.out

Debug is true storeKey true useTicketCache false useKeyTab true doNotPrompt false ticketCache is null isInitiator true KeyTab is /path/to/tomcat/apache-tomcat-7.0.69/conf/sso.keytab refreshKrb5Config is false principal is HTTP/[email protected] tryFirstPass is false useFirstPass is false storePass is false clearPass is false 
Looking for keys for: HTTP/[email protected] 
Added key: 23version: 0 
Looking for keys for: HTTP/[email protected] 
Added key: 23version: 0 
default etypes for default_tkt_enctypes: 23 17. 
>>> KrbAsReq creating message 
>>> KrbKdcReq send: kdc=server001.my.domain UDP:88, timeout=30000, number of retries =3, #bytes=171 
>>> KDCCommunication: kdc=server001.my.domain UDP:88, timeout=30000,Attempt =1, #bytes=171 
>>> KrbKdcReq send: #bytes read=189 
>>>Pre-Authentication Data: 
    PA-DATA type = 11 
    PA-ETYPE-INFO etype = 23, salt = 

>>>Pre-Authentication Data: 
    PA-DATA type = 19 
    PA-ETYPE-INFO2 etype = 23, salt = null, s2kparams = null 

>>>Pre-Authentication Data: 
    PA-DATA type = 2 
    PA-ENC-TIMESTAMP 
>>>Pre-Authentication Data: 
    PA-DATA type = 16 

>>>Pre-Authentication Data: 
    PA-DATA type = 15 

>>> KdcAccessibility: remove server001.my.domain 
>>> KDCRep: init() encoding tag is 126 req type is 11 
>>>KRBError: 
    sTime is Thu Dec 15 15:35:42 CET 2016 1481812542000 
    suSec is 830454 
    error code is 25 
    error Message is Additional pre-authentication required 
    sname is krbtgt/[email protected] 
    eData provided. 
    msgType is 30 
>>>Pre-Authentication Data: 
    PA-DATA type = 11 
    PA-ETYPE-INFO etype = 23, salt = 

>>>Pre-Authentication Data: 
    PA-DATA type = 19 
    PA-ETYPE-INFO2 etype = 23, salt = null, s2kparams = null 

>>>Pre-Authentication Data: 
    PA-DATA type = 2 
    PA-ENC-TIMESTAMP 
>>>Pre-Authentication Data: 
    PA-DATA type = 16 

>>>Pre-Authentication Data: 
    PA-DATA type = 15 

KrbAsReqBuilder: PREAUTH FAILED/REQ, re-send AS-REQ 
default etypes for default_tkt_enctypes: 23 17. 
Looking for keys for: HTTP/[email protected] 
Added key: 23version: 0 
Looking for keys for: HTTP/[email protected] 
Added key: 23version: 0 
default etypes for default_tkt_enctypes: 23 17. 
>>> EType: sun.security.krb5.internal.crypto.ArcFourHmacEType 
>>> KrbAsReq creating message 
>>> KrbKdcReq send: kdc=server001.my.domain UDP:88, timeout=30000, number of retries =3, #bytes=254 
>>> KDCCommunication: kdc=server001.my.domain UDP:88, timeout=30000,Attempt =1, #bytes=254 
>>> KrbKdcReq send: #bytes read=104 
>>> KrbKdcReq send: kdc=server001.my.domain TCP:88, timeout=30000, number of retries =3, #bytes=254 
>>> KDCCommunication: kdc=server001.my.domain TCP:88, timeout=30000,Attempt =1, #bytes=254 
>>>DEBUG: TCPClient reading 1666 bytes 
>>> KrbKdcReq send: #bytes read=1666 
>>> KdcAccessibility: remove server001.my.domain 
Looking for keys for: HTTP/[email protected] 
Added key: 23version: 0 
>>> EType: sun.security.krb5.internal.crypto.ArcFourHmacEType 
>>> KrbAsRep cons in KrbAsReq.getReply HTTP/my.host.com 
principal is HTTP/[email protected] 
Will use keytab 
    [LoginContext]: login success 
Commit Succeeded 

    [LoginContext]: commit success 
Found KeyTab /path/to/tomcat/apache-tomcat-7.0.69/conf/sso.keytab for HTTP/[email protected] 
Found KeyTab /path/to/tomcat/apache-tomcat-7.0.69/conf/sso.keytab for HTTP/[email protected] 
Found ticket for HTTP/[email protected] to go to krbtgt/[email protected] expiring on Fri Dec 16 01:35:42 CET 2016 
Entered SpNegoContext.acceptSecContext with state=STATE_NEW 
SpNegoContext.acceptSecContext: receiving token = a0 82 13 79 30 82 13 75 a0 30 30 2e 06 09 2a 86 48 86 f7 12 01 02 02 
SpNegoToken NegTokenInit: reading Mechanism Oid = 1.2.840.113554.1.2.2 
SpNegoToken NegTokenInit: reading Mechanism Oid = 1.2.840.48018.1.2.2 
SpNegoToken NegTokenInit: reading Mechanism Oid = 1.3.6.1.4.1.311.2.2.30 
SpNegoToken NegTokenInit: reading Mechanism Oid = 1.3.6.1.4.1.311.2.2.10 
SpNegoToken NegTokenInit: reading Mech Token 
SpNegoContext.acceptSecContext: received token of type = SPNEGO NegTokenInit 
SpNegoContext: negotiated mechanism = 1.2.840.113554.1.2.2 
Entered Krb5Context.acceptSecContext with state=STATE_NEW 
Looking for keys for: HTTP/[email protected] 
Added key: 23version: 0 
     [Krb5LoginModule]: Entering logout 
     [Krb5LoginModule]: logged out Subject 
    [LoginContext]: logout success 

が、私はそれ

krb5.ini

[libdefaults] 
    default_realm = MY.DOMAIN 
    default_keytab_name = FILE:/path/to/tomcat/apache-tomcat-7.0.69/conf/sso.keytab 
    default_tkt_enctypes = rc4-hmac,aes256-cts-hmac-sha1-96,aes128-cts-hmac-sha1-96 
    default_tgs_enctypes = rc4-hmac,aes256-cts-hmac-sha1-96,aes128-cts-hmac-sha1-96 
    permitted_enctypes = rc4-hmac,aes256-cts-hmac-sha1-96,aes128-cts-hmac-sha1-96 

[realms] 
    MY.DOMAIN = { 
     kdc = server001.my.domain 
     admin_server = server001.my.domain 
     default_domain = MY.DOMAIN 
} 

[domain_realm] 
    .my.domain = MY.DOMAIN 
    my.domain = MY.DOMAIN 

jaas.confをを長くたくさん短縮されるトークン受け取っ

spnego-client { 
    com.sun.security.auth.module.Krb5LoginModule required; 
}; 

spnego-server { 
    com.sun.security.auth.module.Krb5LoginModule required 
    storeKey=true 
    useKeyTab=true 
    keyTab="/path/to/tomcat/apache-tomcat-7.0.69/conf/sso.keytab" 
    principal="HTTP/[email protected]" 
    debug=true; 
}; 

web.xmlの

<login-config> 
    <auth-method>SPNEGO</auth-method> 
</login-config> 

<security-constraint> 
    <web-resource-collection> 
    <web-resource-name>SSO Login</web-resource-name> 
    <url-pattern>/*</url-pattern> 
    </web-resource-collection> 
    <auth-constraint> 
    <role-name>*</role-name> 
    </auth-constraint> 
</security-constraint> 

アーキテクチャ

  • ADサーバーのWindows Server 2016
  • のOracle JVMとTomcat 7.0.69を使用したアプリケーション・サーバーのUnix-Redhat6
  • クライアントWindows 10(Internet Explorer 11搭載)
+0

TomcatはどのOSが動作していて、Active Directory(AD)ドメインコントローラとは別のサーバーで動作しているのですか?あなたのクライアントはどのOSバージョンとウェブブラウザ/バージョンで動作していますか?どのADバージョンがありますか? –

+0

@ T-Heronあなたの返事をありがとう!私は説明に情報を追加しました。わかりません。私は、「PREAUTH FAILED/REQ」メッセージを引き起こしている気持ちがあります。 「PREAUTH FAILED/REQ」メッセージは、認証が機能している私のテスト環境にも表示されるので、無関係かもしれないと思った。 – user2043423

+0

いくつかの理由により、「PREAUTH FAILED/REQ」メッセージが失敗する可能性があります。そのうちの1つは、問題のあるサーバーが正しいキータブを使用していないことです。keytabを使用してKerberosチケットを取得できるかどうかを調べるには、このコマンドを実行します。_kinit -V -k -t /path/to/tomcat/apache-tomcat-7.0 .69/conf/sso.keytab HTTP/[email protected]_ –

答えて

0

T-Heronのおかげで解決策を見つけることができました。 keytabファイルが誤った暗号化タイプで生成されました。 Windows7/10のために、私の環境では、それが正しいのktpassコール

AES256-SHA1 に明示的に設定する必要がありました:

ktpass -out D:\TEMP\sso.keytab -mapuser MYUSER -princ HTTP/[email protected] -ptype KRB5_NT_PRINCIPAL -kvno 0 -crypto AES256-SHA1 -pass **** 

は、サポートのためにありがとうございました!!!

+0

それを聞いてうれしい! –

関連する問題