okay, the virtual directories we figured out. my boss found winfuse, which allows us to create our own file system. however, now the problem is trying to figure out how to implement custom authentication.
i added the following to applicationHost.config (obviously i changed the namespace, assembly name, and key):
<system.ftpServer>
<providerDefinitions>
<add name="IisManagerAuth" type="Microsoft.Web.FtpServer.Security.IisManagerAuthenticationProvider,Microsoft.Web.FtpServer,version=7.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35" />
<add name="AspNetAuth" type="Microsoft.Web.FtpServer.Security.AspNetFtpMembershipProvider,Microsoft.Web.FtpServer,version=7.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35" />
<add name="MyAuthProvider" type="Data.MyAuthProvider,Data,version=2.0.3.0, Culture=neutral,PublicKeyToken=2335d14bdda8ae70" />
</providerDefinitions>
</system.ftpServer>
then wrote the following code:
namespace Data
{
public class MyAuthProvider : IFtpAuthenticationProvider, IFtpProvider
{
bool IFtpAuthenticationProvider.AuthenticateUser( string sessionId, string siteName, string userName, string userPassword,
out string canonicalUserName )
{
canonicalUserName = userName;
return true;
}
public void ConfigurationUpdated()
{
}
}
}
upon compilation, i drop the Data assembly into the gac as a post-build.
i then set my FTP Authentication to use the provider, and end up with the following error:
C:\Users\Administrator>ftp localhost
Connected to ryanbox.
220 Microsoft FTP Service
User (ryanbox:(none)): ryan
331 Password required for ryan.
Password: ****
530-User cannot log in.
Win32 error: No such interface supported
Error details: An error occured during the authentication process.
530 End
Login failed.
ftp>
i don't see the Win32 error in the event logs, nor the ftp logs. the reason i chose to implement the IFtpAuthenticationProvider and IFtpProvider interfaces is because that's what AspNetFtpMembershipProvider and IisManagerAuthenticationProvider implement. i'm assuming both of those work, but haven't tested them yet.
has anybody actually implemented a custom authentication provider for FTP 7? anybody know how i can get the actual error?
a couple more details. since the Microsoft.Web.FtpServer assembly is in the gac, but visual studio 2008 doesn't display all of the gac assemblies in the add references dialog box, I copied the assembly to a different directory, and added a reference to it that way.
also, i can't figure out how to attach to the ftp process from visual studio. i'm deving on windows 2008, since ftp 7 rtm doesn't actually install on vista. i don't see w3wp or any other process that looks like something i can attach to. i have all the iis 6 metabase functionality installed.
finally, a gripe: whoever's on the ftp 7 team, next time you release a product and advertise a feature (extensible authentication), you think you can release some freakin' examples, or maybe some instructions? it doesn't do much good to say that authentication is extensible, but then leave it up to the developer to fiddle with interfaces and configs and try and find the winning combination. thanks.
ryan cammer