连接到kerberos javax.security.auth.login.LoginException时出错:无法从System.in读取

时间:2014-07-26 01:31:30

标签: java kerberos spnego

您好我从我的unix服务器连接到kerberos时遇到以下错误,在本地虽然工作正常。远程有jdk 1.7.0_45。请帮助

我的login.conf是

tom-sync{
    com.sun.security.auth.module.Krb5LoginModule required
    storeKey=true
    useKeyTab=true
    doNotPrompt=true
    keyTab="///apps/tom/resources/kb/tom_user.keytab"
    principal="tom@COMSI.COM"
    isInitiator=false;
};

异常

Caused by: org.ietf.jgss.GSSException: No valid credentials provided (Mechanism level: Attempt to obtain new INITIATE credentials failed! (null))
       at sun.security.jgss.krb5.Krb5InitCredential.getTgt(Krb5InitCredential.java:351) ~[?:1.7.0_45]
       at sun.security.jgss.krb5.Krb5InitCredential.getInstance(Krb5InitCredential.java:145) ~[?:1.7.0_45]
       at sun.security.jgss.krb5.Krb5MechFactory.getCredentialElement(Krb5MechFactory.java:121) ~[?:1.7.0_45]
       at sun.security.jgss.GSSManagerImpl.getCredentialElement(GSSManagerImpl.java:192) ~[?:1.7.0_45]
       at sun.security.jgss.spnego.SpNegoMechFactory.getCredentialElement(SpNegoMechFactory.java:141) ~[?:1.7.0_45]
       at sun.security.jgss.GSSManagerImpl.getCredentialElement(GSSManagerImpl.java:192) ~[?:1.7.0_45]
       at sun.security.jgss.GSSCredentialImpl.add(GSSCredentialImpl.java:406) ~[?:1.7.0_45]
       at sun.security.jgss.GSSCredentialImpl.<init>(GSSCredentialImpl.java:60) ~[?:1.7.0_45]
       at sun.security.jgss.GSSManagerImpl.createCredential(GSSManagerImpl.java:153) ~[?:1.7.0_45]
       at net.sourceforge.spnego.SpnegoProvider$1.run(SpnegoProvider.java:171) ~[spnego-7.0.jar:?]
       at net.sourceforge.spnego.SpnegoProvider$1.run(SpnegoProvider.java:1) ~[spnego-7.0.jar:?]
       at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_45]
       at javax.security.auth.Subject.doAs(Subject.java:415) ~[?:1.7.0_45]
       at net.sourceforge.spnego.SpnegoProvider.getClientCredential(SpnegoProvider.java:179) ~[spnego-7.0.jar:?]
       at net.sourceforge.spnego.SpnegoHttpURLConnection.getGSSContext(SpnegoHttpURLConnection.java:525) ~[spnego-7.0.jar:?]
       at net.sourceforge.spnego.SpnegoHttpURLConnection.connect(SpnegoHttpURLConnection.java:329) ~[spnego-7.0.jar:?]
       ... 82 more
Caused by: javax.security.auth.login.LoginException: Cannot read from System.in
       at com.sun.security.auth.module.Krb5LoginModule.promptForName(Krb5LoginModule.java:824) ~[?:1.7.0_45]
       at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:671) ~[?:1.7.0_45]
       at com.sun.security.auth.module.Krb5LoginModule.login(Krb5LoginModule.java:584) ~[?:1.7.0_45]
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_45]
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_45]
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_45]
       at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_45]
       at javax.security.auth.login.LoginContext.invoke(LoginContext.java:784) ~[?:1.7.0_45]
       at javax.security.auth.login.LoginContext.access$000(LoginContext.java:203) ~[?:1.7.0_45]
       at javax.security.auth.login.LoginContext$5.run(LoginContext.java:721) ~[?:1.7.0_45]
       at javax.security.auth.login.LoginContext$5.run(LoginContext.java:719) ~[?:1.7.0_45]
       at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_45]
       at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:718) ~[?:1.7.0_45]
       at javax.security.auth.login.LoginContext.login(LoginContext.java:590) ~[?:1.7.0_45]

0 个答案:

没有答案