hierynomus / smbj

Server Message Block (SMB2, SMB3) implementation in Java
Other
713 stars 180 forks source link

STATUS_LOGON_FAILURE after trying to authenticate with AuthenticationContext with special characters in password #748

Open KnispoDisig opened 1 year ago

KnispoDisig commented 1 year ago

Hi everyone!

I'm trying to authenticate with the help of AuthenticationContext connecting to host.

    AuthenticationContext authContext = new AuthenticationContext(
                  credentials.username, 
                  credentials.password.toCharArray, 
                  credentials.domain
              );
    connection.authenticate(authContext);

My password contains special characters such as !, @, #, $, < and so on. This procedure fails with STATUS_LOGON_FAILURE trying to authenticate on the host. I saw some issues (like https://github.com/hierynomus/smbj/issues/297 and https://github.com/hierynomus/smbj/issues/454) about this problem but it didn't help me.

I tried to URL encode my special characters and use backslash before them, it didn't help either. Is there any solution to this problem? Thank you in advance.

hierynomus commented 1 year ago

I think the problem could be on the server side instead of on SMBJ's side. What is the logging that you're seeing? Is authentication succeeding with another (non-Java) SMB client?