RE: Webserver and FTP user authentication

From: shiva (shiva_at_discussions.microsoft.com)
Date: 01/04/05


Date: Tue, 4 Jan 2005 09:57:03 -0800

Thanks for your replies ....... i tried out as you said but still i'm facing
some problems. I created a MFC exe and wrote the same code in OnButton
dialog. when i registered it successfully called setUserInfo function. As you
said i made changes but still i'm not able to access my default page when i
set to A=1. still anything i need to do. what i did is correct only. after
registering my exe where will be the users info will be stored. when i called
that function i passed my network username and password. still i'm facing
problem, please could you clarify it...

"Corey Burke [MS]" wrote:

> There are two types of users we're talking about here. Local and Domain.
> Domain users have their passwords verified by the domain controller for
> example mydomain.microsoft.com. Local users have their names+passwords
> stored on the local device and are created using the NTLMSetUserInfo()
> function or via the RemoteAdmin web ISAPI.
>
> After you set the DefaultDomain key, you'll need to reset the device to get
> it to use the new settings. When you set A=1 in the virtual root, you'll
> get prompted for credentials. Enter in your domain credentials:
> MYDOMAIN\DomainUserName and DomainUserPass. The local PC you're using to
> view the web page will create an encrypted NTLM package that it will send
> to the CE server. The CE server will then send this package on to the
> domain controller which will decrypt it, verify the password and reply to
> the CE device with whether or not the credentials were valid. The CE
> device does not actually store your domain credentials and for security
> reasons, it should not.
>
> For local user authentication you need to create a user with
> NTLMSetUserInfo, like the following:
>
> typedef BOOL ( *PFnSetUser )(IN LPCTSTR pszUser, IN LPCTSTR pszPassword);
>
> HMODULE hModule = NULL;
> PFnSetUser pFnSetUser;
>
> hModule = LoadLibrary( _T("ntlmssp.dll") );
>
> if( hModule == NULL )
> {
> QAError( TEXT("LoadLibrary() failed, error = %d"), GetLastError() );
> return FALSE;
> }
>
> pFnSetUser = (PFnSetUser)GetProcAddress(hModule, _T("NTLMSetUserInfo"));
> if(!pFnSetUser)
> return FALSE;
>
> pFnSetUser( _T("user1"), _T("pass1") );
>
> Then put the local user's name in the UserList for the website like so, and
> reset the web server to get the web server to read the new settings:
> [HKEY_LOCAL_MACHINE\Comm\HTTPD]
> "UserList"="user1"
>
> The same goes for FTP authentication.
> -Corey
>
>