Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4k views
in CompleteFTP by (540 points)
I'm looking into using this for my company and couldn't find any documentation on this. I saw that the server does support active directory.

Thanks :)
Kathy

2 Answers

0 votes
by (51.6k points)
Hi Kathy

While CompleteFTP doesn't support ASP.NET membership authentication out-of-the-box, it does allow you to create your own authentication plug-ins in C# or VB.NET. A simple example is shown below:
using EnterpriseDT.Net.FtpServer.Core;

namespace MyTestAuthenticator
{
  public class SimpleAuthenticator : Authenticator
  {
    public override void CheckUserName(IUserInfo userInfo)
    {
      if (userInfo.UserName == "myusername")
        userInfo.IsValidUserName = true;
    }

    public override void Authenticate(IAuthenticationInfo authInfo)
    {
      if (authInfo.Password == "mypassword")
      {
        authInfo.IsCorrectPassword = true;
        authInfo.HomeDirectory = "C:\\Temp";
      }
    }
  }
}


In your case you'd probably need to call the Membership.Validate method in the Authenticate method to see if the user is allowed to log in. I haven't tried this, so I don't know for sure.

I hope that helps. Please let me know if you have any further questions.

- Hans Andersen (EnterpriseDT)
0 votes
by (51.6k points)
It may be as simple as this:
using EnterpriseDT.Net.FtpServer.Core; 
using System.Web.Security; 

namespace AspNetMembershipAuthenticator 
{ 
  public class AspNetMembershipAuthenticator : Authenticator 
  { 
    public override void CheckUserName(IUserInfo userInfo) 
    {
      userInfo.IsValidUserName = Membership.GetUser(userInfo.UserName)!=null; 
    } 

    public override void Authenticate(IAuthenticationInfo authInfo) 
    { 
      authInfo.IsCorrectPassword = Membership.Validate(authInfo.UserName, authInfo.Password);
    } 
  } 
}

Categories

...