0 votes
by (150 points)

Hi,

The client that is connecting is old and does not have support for a password :(

I'm using a modified version of the file server example shown here: https://www.rebex.net/file-server.

I want to add 1 user that uses a username - no password.

I've tried adding:

server.Settings.AllowedAuthenticationMethods = AuthenticationMethods.None;

// register authentication event handler
server.Authentication += (sender, e) =>
{
  if (e.UserName.Equals("user01"))
  {
     e.Accept(new FileServerUser(e.UserName, null));
  }
  else
  {
      e.Reject();
  }
};

but this does not work and an error is generated:

Disconnected: No supported authentication methods available (server sent:)

The current private key being used does not have a passphrase implemented.

Can you suggest any solution or method to get this working?

Thanks in advance

1 Answer

0 votes
by (147k points)
selected by
 
Best answer

Hi, what exactly does it mean that the client does not have support for a password? Does it mean it's issuing a "none" authentication request that should get accepted based only on the user name? Unfortunately, such scenario is not currently supported by Rebex File Server, but it seems it would be simple to add. If this is what you need, please let us know, chances are we will have a working beta soon.

by (150 points)
Hi Lukas,

That's pretty much it. The main part of client application does not have any password options and seems to be reliant on the username after the connection is made.  

But, sub system of this application can issues a public key. Is there any sample code i can use which allow users to connect strictly by keys and does not prompt for a password? Again the private key does not have any passphrase.

I did try this:

https://www.rebex.net/file-server/features/authentication.aspx#public-key

but could not get it to work,

Regards,
by (150 points)
Hi Lukas,

Forget about the public key part of the question. I made the mistake of not loading the private key correctly at the server end, it's all working correctly now,
by (147k points)
OK, thanks for letting us know! I think we will add support for "none" authentication as well, mostly for the sake of completeness.
by (147k points)
Since Rebex File Server 2020 R3, it is possible to authenticate using "none" authentication. This can be enabled using the following code:

server.Users.Add("user01", "does not matter", "c:/PublicData");

server.Settings.AllowedAuthenticationMethods |= AuthenticationMethods.External;
server.PreAuthentication += (sender, e) =>
{
    if (e.UserName == "user01")
    {
        ServerUser user = ((FileServer)sender).Users[e.UserName];
        e.AcceptWithoutAuthentication(user);
    }
    else
    {
        e.Accept(AuthenticationMethods.Any);
    }
};

server.Start();
...