各位大家好(对不起我的英文),我正在使用这个库(这是一个使用kerberos / spnego登录SSO的过滤器):
http://spnego.sourceforge.net/
我有一个用java(spring)开发的应用程序,它部署在IBM Websphere 8.5.5.8(ibm jdk 1.7)中。部署还可以。
我提到的库(spnego.jar)放在下一个路径中: [WAS_HOME_INSTALL] /应用服务器/ lib / ext目录/
我在Websphere中将krb5.conf文件和login.conf文件添加为jvm参数。
部署后我启动了应用程序,当它尝试进行身份验证时,会显示下一条消息:
没有Kerberos在keytab中为主体提供信誉 HTTP/PWAS02.olympus.corp@OLYMPUS.CORP
这是日志文件:
[2/28/18 17:03:22:996 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 JAAS config: debug=true
[2/28/18 17:03:22:996 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 JAAS config: principal=HTTP/PWAS02.olympus.corp@OLYMPUS.CORP
[2/28/18 17:03:22:996 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 JAAS config: credsType=accept only
[2/28/18 17:03:22:996 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 config: useDefaultCcache=false (default)
[2/28/18 17:03:22:996 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 config: useCcache=null
[2/28/18 17:03:22:996 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 config: useDefaultKeytab=false
[2/28/18 17:03:22:996 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 config: useKeytab=/Apps/SSOpoc/SPNEGO/appsvr.keytab
[2/28/18 17:03:22:997 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 JAAS config: forwardable=false (default)
[2/28/18 17:03:22:998 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 JAAS config: renewable=false (default)
[2/28/18 17:03:22:998 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 JAAS config: proxiable=false (default)
[2/28/18 17:03:22:998 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 JAAS config: tryFirstPass=false (default)
[2/28/18 17:03:22:998 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 JAAS config: useFirstPass=false (default)
[2/28/18 17:03:22:998 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 JAAS config: moduleBanner=false (default)
[2/28/18 17:03:22:998 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 JAAS config: interactive login? no
[2/28/18 17:03:22:998 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 Try keytab for principal=HTTP/PWAS02.olympus.corp@OLYMPUS.CORP
[2/28/18 17:03:23:006 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 No Kerberos creds in keytab for principal HTTP/PWAS02.olympus.corp@OLYMPUS.CORP
[2/28/18 17:03:23:007 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 Login successful
[2/28/18 17:03:23:007 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 kprincipal : HTTP/PWAS02.olympus.corp@OLYMPUS.CORP
[2/28/18 17:03:23:008 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 HTTP/PWAS02.olympus.corp@OLYMPUS.CORP added to Subject
[2/28/18 17:03:23:008 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 Attempting to add KeyTab to Subject for HTTP/PWAS02.olympus.corp@OLYMPUS.CORP
[2/28/18 17:03:23:008 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 find keys for HTTP/PWAS02.olympus.corp@OLYMPUS.CORP
[2/28/18 17:03:23:008 PET] 00000082 SystemOut O [JGSS_DBG_CRED] WebContainer : 1 No keys to add to Subject for HTTP/PWAS02.olympus.corp@OLYMPUS.CORP
[2/28/18 17:03:23:027 PET] 00000082 SystemOut O 17:03:23.027 [WebContainer : 1] INFO SpnegoHttpFilter - creds=
--- GSSCredential ---
Number of mehanism credentials: 1
[1] SPNEGOCredential
Owner: default
Usage: Accept Only
Start Time: 2/28/18 5:03 PM
InitLifetime: 0 Seconds
AcceptLifetime: INDEFINITE
--- End of GSSCredential ---
当我使用Java本机库时,这是我的login.conf文件
spnego-client {
com.sun.security.auth.module.Krb5LoginModule required;
};
spnego-server {
com.sun.security.auth.module.Krb5LoginModule required
useKeyTab=true
keyTab="file://C:/Apps/SSOpoc/SPNEGO/appsvr.keytab"
storeKey=true
isInitiator=false
useTicketCache=false
principal="HTTP/OLYSOFT-WS.olympus-corp.info@OLYMPUS-CORP.INFO"
debug=true;
};
当我使用Java IBM jdk时,这是login.conf
spnego-client {
com.ibm.security.auth.module.Krb5LoginModule required;
};
spnego-server {
com.ibm.security.auth.module.Krb5LoginModule required
principal="HTTP/PWAS02.olympus.corp@OLYMPUS.CORP"
credsType=acceptor
useDefaultKeytab=false
useKeytab="file:/Apps/SSOpoc/SPNEGO/appsvr.keytab"
serviceAccountName=appsvr
debug=true;
};
我不知道IBM login.conf中 storeKey (在主体的私有凭证中存储密钥)参数的等价物(我认为这是我日志中出错的主要原因) )。
请感谢任何帮助。 谢谢你的时间。