How to resolve Mule SFTP Kerberos username and password prompt in Mule 4 Version: Mule 4.3

Viewed 576

I am facing SFTP Kerberos username and prompt for first time run of service. The subsequent run of service is running fine. Kerberos is not prompt when the SFTP location is within a network. If it is a different network it asks for Kerberos username and password.

Starting Bean: org.mule.runtime.module.extension.internal.runtime.config.ConfigurationProviderToolingAdapter-Database_Config INFO 2020-07-29 14:21:42,151 [WrapperListener_start_runner] [processor: ; event: ] org.mule.runtime.core.privileged.lifecycle.AbstractLifecycleManager: Starting Bean: org.mule.runtime.module.extension.internal.runtime.config.ConfigurationProviderToolingAdapter-SFTP_Config Kerberos username [nmarathe]:

Kerberos password for nmarathe:

INFO 2020-07-29 14:21:55,531 [WrapperListener_start_runner] [processor: ; event: ] org.mule.runtime.core.privileged.lifecycle.AbstractLifecycleManager: Starting Bean: org.mule.runtime.module.extension.internal.runtime.config.ConfigurationProviderToolingAdapter-Java_Config

Key Tips: preferredAuthenticationMethods="publickey,password,keyboard-interactive" this is failing to deploy app.

<sftp:config name="SFTP_Config" doc:name="SFTP Config"
    doc:id="b5762201-a868-4a1a-ab96-9b7669451708">
    <sftp:connection
        workingDir="${sftp.path}"
        host="${sftp.host}" username="${sftp.user}"
        password="${sftp.password}" port="${sftp.port}" connectionTimeout="120" preferredAuthenticationMethods="publickey,password,keyboard-interactive">
        <reconnection>
            <reconnect frequency="30000" count="20" />
        </reconnection>
    </sftp:connection>
    <expiration-policy maxIdleTime="2" timeUnit="MINUTES" />
</sftp:config>

Error: Element 'publickey,password,keyboard-interactive' is not defined in the Mule Registry

1 Answers

After a lot of dig into the issue. I found a solution from documentation only. Refer: https://docs.mulesoft.com/sftp-connector/1.3/sftp-documentation#parameters-2

I just added below code in the SFTP connection. preferredAuthenticationMethods="#[['PUBLIC_KEY','KEYBOARD_INTERACTIVE','PASSWORD']]"

PFB the detail code which resolved my issue.

<sftp:config name="SFTP_Config" doc:name="SFTP Config">
    <sftp:connection
        workingDir="${sftp.path}"
        host="${sftp.host}" username="${sftp.user}"
        password="${sftp.wms.password}" port="${sftp.port}" connectionTimeout="120" preferredAuthenticationMethods="#[['PUBLIC_KEY','KEYBOARD_INTERACTIVE','PASSWORD']]">
        <reconnection>
            <reconnect frequency="30000" count="20" />
        </reconnection>
    </sftp:connection>
    <expiration-policy maxIdleTime="2" timeUnit="MINUTES" />
</sftp:config>
Related