1

我正在运行以下教程:http: //download.oracle.com/javase/6/docs/technotes/guides/security/jgss/tutorials/BasicClientServer.html

我收到以下提示:

Connected to server localhost/127.0.0.1
Kerberos username [login]: {I enter my username here}
Kerberos password for login: {I enter my password here}

我收到以下错误:

你能确定这件事的根本原因吗?

Exception in thread "main" GSSException: No valid credentials provided (Mechanism level: Attempt to obtain new INITIATE credentials failed! (null))
at sun.security.jgss.krb5.Krb5InitCredential.getTgt(Krb5InitCredential.java:333)
at sun.security.jgss.krb5.Krb5InitCredential.getInstance(Krb5InitCredential.java:128)
at sun.security.jgss.krb5.Krb5MechFactory.getCredentialElement(Krb5MechFactory.java:106)
at sun.security.jgss.krb5.Krb5MechFactory.getMechanismContext(Krb5MechFactory.java:172)
at sun.security.jgss.GSSManagerImpl.getMechanismContext(GSSManagerImpl.java:209)
at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:195)
at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:162)
at demo.SampleClient.main(SampleClient.java:145)
Caused by: javax.security.auth.login.LoginException: Message stream modified (41)
at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:696)
at com.sun.security.auth.module.Krb5LoginModule.login(Krb5LoginModule.java:542)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
at sun.security.jgss.GSSUtil.login(GSSUtil.java:246)
at sun.security.jgss.krb5.Krb5Util.getTicket(Krb5Util.java:136)
at sun.security.jgss.krb5.Krb5InitCredential$1.run(Krb5InitCredential.java:328)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.jgss.krb5.Krb5InitCredential.getTgt(Krb5InitCredential.java:325)
... 7 more
Caused by: KrbException: Message stream modified (41)
at sun.security.krb5.KrbKdcRep.check(KrbKdcRep.java:53)
at sun.security.krb5.KrbAsRep.<init>(KrbAsRep.java:96)
at sun.security.krb5.KrbAsReq.getReply(KrbAsReq.java:449)
at sun.security.krb5.Credentials.sendASRequest(Credentials.java:410)
at sun.security.krb5.Credentials.acquireTGT(Credentials.java:378)
at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:662)
... 23 more
4

3 回答 3

4

当 Kerberos 领域不匹配时,我收到异常“消息流已修改 (41)”。领域(在系统属性中java.security.krb5.realm)必须完全匹配,包括大写/小写。

于 2012-03-02T12:37:47.500 回答
2

我想知道这是否有可能(即即使设置了注册表项,对本地管理员锁定):

http://cr.openjdk.java.net/~weijun/special/krb5winguide-2/raw_files/new/kwin

已知的问题

如果在客户端 PC 上还将 AD 帐户添加到本地管理员组中,Microsoft 会限制此类客户端获取票证的会话密钥(即使您将 allowtgtsessionkey 注册表项设置为 1)。解决方法是:忘记您是登录用户,调用 kinit.exe。不依赖于 LSA 凭证缓存。

于 2011-07-19T07:06:00.750 回答
0

我无法确认这个问题。我在我的机器上确实拥有管理员权限,并且仍然能够从 LSA 获取会话密钥。您应该在 JGSS 和 Krb5LoginModule 上启用完整的调试输出。也分享您的 krb5.ini 和 login.conf。我希望您知道上述示例无法运行,因为您的客户端无法获得本地主机的票证。它必须是在 Active Directory 中设置了适当 SPN 的 FQDN。

于 2011-07-20T09:07:01.243 回答