Our web application is deployed to WebLogic 10.3 and uses VFS to send files
to a SFTP server.
After the initial deployment we hit this error:
Caused by: java.lang.IllegalArgumentException: No Configuration was
registered that can handle the configuration named
com.sun.security.jgss.krb5.initiate
at
com.bea.common.security.jdkutils.JAASConfiguration.getAppConfigurationEntry(JAASConfiguration.java:124)
at
sun.security.jgss.LoginConfigImpl.getAppConfigurationEntry(LoginConfigImpl.java:139)
at
javax.security.auth.login.LoginContext.init(LoginContext.java:243)
at
javax.security.auth.login.LoginContext.<init>(LoginContext.java:499)
at sun.security.jgss.GSSUtil.login(GSSUtil.java:244)
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)
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
com.jcraft.jsch.jgss.GSSContextKrb5.init(GSSContextKrb5.java:129)
at
com.jcraft.jsch.UserAuthGSSAPIWithMIC.start(UserAuthGSSAPIWithMIC.java:135)
at com.jcraft.jsch.Session.connect(Session.java:419)
at com.jcraft.jsch.Session.connect(Session.java:150)
at
org.apache.commons.vfs.provider.sftp.SftpClientFactory.createConnection(SftpClientFactory.java:210)
... 69 more
After researching in the Jsch forums, etc, if learned that if we could set
the property "PreferredAuthentications" "with the value publickey,password"
on the underlying Jsch implementation session, we could shortcircuit the
call calls to look for a kerberos configuration.
What I need to know is, how can I set this parameter through the existing
VFS apis rather than changing the source code? Here is the source code
change I had to make in the SftpClientFactory class:
config.setProperty("PreferredAuthentications",
"publickey,password");
//set properties for the session
if (config.size() > 0)
{
session.setConfig(config);
}
session.setDaemonThread(true);
session.connect();
The API for the SftpFileSystemConfigBuilder has only a handful of specific
properties that can be set, such as d setStrictHostKeyChecking( ), but not a
generic way to pass through other properties, or at least not a way we could
find.
Thanks in advance for any help to access the underlying Jsch functionality.