Search code examples
javasftpjschftps

Does JSch allow to understand that I provided wrong credentials?


I am novice with JSch library.
I need to validate login credentials.
How can I make it? connect and check response code?

P.S. I cannot find information in doc.


Solution

  • try {
           session.connect();
    } catch (JSchException e) {
           if ("Auth fail".equals(e.getMessage())) {
                isSuccess = false; //Auth fail
           }
    }