Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Guest

Re: Auth abruptly started failing for COM library but not for Client

I hesitate to post that on an open forum, and I know without it you can't help. I hope you understand.

Follow up:
It magically started working this afternoon (Some kind of quota expired???). Is there a way the SFTP server could differentiate between the two different installs and their connections?

The session URL is in the form sshftp.<name>.com
I did verify that the credentials, URL and fingerprint were the same. In fact, I hardcoded them in the script to make sure.

Thanks for the reply.
martin

Re: Auth abruptly started failing for COM library but not for Client

Please post session URL both from the GUI and the code (running both on the same machine in the same user session/environment).
jackd

Auth abruptly started failing for COM library but not for Client

I am using the following code to connect to our SFTP server.
Up until a few hours ago this was working.
I can connect via the same user/password via the WinSCP client (Full Install), but not via the COM library (WinSCP-6.5.4-Automation.zip).
I receive the following error:
<path>\install.ps1 : Exception calling "Open" with "1" argument(s): "Authentication failed.
Authentication log (see session log for details):
Using username "j****d@*****.com".
Access denied.
Authentication failed."

I have verified my credentials and that this is the only WinSCPnet.dll available to the PowerShell 5.x script.
Is there any known issue, or have they simply blocked the call from the library?
I can post redacted logs if necessary.
Thank you
Add-Type -Path "<path>\WinSCP-6.5.4-Automation\WinSCPnet.dll"
$credential = $null
if ($host -and $host.UI -and $host.UI.PromptForCredential) {
    $credential = $host.UI.PromptForCredential(
        $Config.LoginTitle,
        $Config.LoginPrompt,
        "",
        "MyCompany-SFTP"
    )
}
if (-not $credential) { throw "Credentials not provided." }
$session = New-Object WinSCP.Session
$session.DebugLogPath  = $Config.DebugLogPath
$session.DebugLogLevel = $Config.DebugLogLevel
$session.add_FileTransferProgress( { Show-FileTransferProgress($_) } )
$session.Open(
    (New-Object WinSCP.SessionOptions -Property @{
        Protocol              = [WinSCP.Protocol]::Sftp
        HostName              = $Config.HostName
        UserName              = $credential.UserName
        SecurePassword        = $credential.Password # Password: A SecureString containing the password.
        SshHostKeyFingerprint = $Config.HostKeyFingerprint
    })
)