Skip to content

Commit

Permalink
fix(sftp): force preferred authentication methods to prevent Kerberos…
Browse files Browse the repository at this point in the history
… auth
  • Loading branch information
brian-mulier-p committed Dec 21, 2023
1 parent e60d7ad commit 23a8065
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/io/kestra/plugin/fs/sftp/SftpService.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public static FileSystemOptions fsOptions(RunContext runContext, SftpInterface s
}

if (sftpInterface.getKeyfile() != null) {
instance.setPreferredAuthentications(options, "publickey");

File sftpKey = runContext.tempFile(
runContext.render(sftpInterface.getKeyfile()).getBytes(StandardCharsets.UTF_8)
).toFile();
Expand All @@ -69,6 +71,8 @@ public static FileSystemOptions fsOptions(RunContext runContext, SftpInterface s
}

instance.setIdentityProvider(options, identityInfo);
} else {
instance.setPreferredAuthentications(options, "password");
}

return options;
Expand Down

0 comments on commit 23a8065

Please sign in to comment.