2014-11-06 113 views
3

我試圖在Tomcat上使用SPNEGO實現基於瀏覽器的單點登錄。帶Tomcat的SPNEGO錯誤:GSSException:未在GSS-API級別指定失敗(機制級別:Checksum失敗)

我按照這兩個頁面的所有指令:

當我訪問從Firefox或Chrome hello_spnego.jsp,我被要求輸入用戶名和密碼,然後它完美地顯示我的用戶名;像魅力一樣工作。然而,當我試圖與IE瀏覽器訪問它,我得到這個錯誤:

HTTP Status 500 - GSSException: Failure unspecified at GSS-API level (Mechanism level: Checksum failed) 

type Exception report 

message GSSException: Failure unspecified at GSS-API level (Mechanism level: Checksum failed) 

在試圖尋找一個解決方案,我碰到這個頁面來了:http://www.oracle.com/technetwork/articles/idm/weblogic-sso-kerberos-1619890.html

我跟着客戶端配置說明頁面的後半部分。之後,所有三種瀏覽器(Chrome瀏覽器,Firefox和IE)都顯示相同的錯誤,但他們都不再要求用戶名和密碼。

我已驗證用於與KDC通話的帳戶是否正常工作。另外,我有在web.xml文件中指定的用戶名和密碼,所以我沒有單獨的KeyTab文件。

診斷的目的,這裏有我的krb5.conf和login.conf的文件的內容:

的krb5.conf

[libdefaults] 
    default_realm = DEVID.LOCAL 
    default_tkt_enctypes = aes256-cts aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 aes128-cts rc4-hmac des3-cbc-sha1 des-cbc-md5 des-cbc-crc arcfour-hmac arcfour-hmac-md5 
    default_tgs_enctypes = aes256-cts aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 aes128-cts rc4-hmac des3-cbc-sha1 des-cbc-md5 des-cbc-crc arcfour-hmac arcfour-hmac-md5 
    permitted_enctypes = aes256-cts aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 aes128-cts rc4-hmac des3-cbc-sha1 des-cbc-md5 des-cbc-crc arcfour-hmac arcfour-hmac-md5 

[realms] 
    DEVID.LOCAL = { 
     kdc = cdi-prod.devid.local 
     default_domain = DEVID.LOCAL 
} 

[domain_realm] 
    .DEVID.LOCAL = DEVID.LOCAL 

login.conf的

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

spnego-server { 
    com.sun.security.auth.module.Krb5LoginModule required 
    storeKey=true 
    isInitiator=false; 
}; 

因爲我沒有keytab文件,所以在login.conf文件中沒有提到它。

此外,由於我使用的是aes256-cts加密,因此我在jdk的jre/lib/security文件夾中添加了必需的JCE策略文件(http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html)。

僅供參考,我使用的是Tomcat 8和JDK 1.8。

我真的很感謝這裏發生了什麼。如果您需要更多信息,請告訴我。提前致謝!

+0

你解決了你的問題嗎? – markus 2015-03-25 15:06:09

回答

0

我有同樣的問題,找到答案在this post

...go to the Advanced settings of IE (Internet Options > Advanced tab) and disable the "Enable Integrated Windows Authentication" checkbox, this error goes away, and I am able to see the logged in user's handle on IE as well...

回覆你嘗試之後在此之前的預言文章後所做的任何更改。

0

的Kerberos SPNEGO校驗失敗的問題

click

我爲我的web應用程序由SPNEGO認證。在開發過程中我遇到了使用密鑰表文件的HTTP服務一個用戶身份認證的問題:

產生的原因:org.ietf.jgss.GSSException中:未指定的失敗在GSS-API級別(級別機制:校驗和失敗)

我我發現解決方案如何解決問題。我用RHEL 7上的服務器和客戶端,並且FreeIPA作爲KDC/LDAP服務器:

  1. web應用程序服務器上的打開的/etc/krb5.conf並添加到節[libdefaults]一行

    [libdefaults]

    default_tkt_ enctypes = ARCFOUR-HMAC-MD5

,這是最重要的事情。這條線解決 「校驗失敗」 的問題

  • 在客戶端: 的kinit用戶名 密碼[email protected]
  • Kerberos中域認證成功後,我們可使用捲曲訪問基於Kerberos的網絡應用程序:

    捲曲-v -k --negotiate -u:--cacert /etc/ipa/ca.crt https://myservice.com:8090/krb

  • 在火狐,打印有關:在地址欄配置 - >我答應 - >然後找到
  • network.negotiate-auth.delegation-URI的值http://,https://

    network.negotiate-auth.trusted-URI的值.myservice。 com

    0

    我已發佈一個類似的問題的答案here

    我的情況不是GSSAPI + HTTP,但我想SPNEGO在幕後使用相同的機制。