When I enabled Windows authentication in CS NNTP Server (2.0 RTM) and run it in console or service mode, it always returned "280 Unknown user or invalid credentials". After traced inside the nntp component, I found After CommunityServer.NntpServer.Components.NntpContext.ValidateUser() indirectly call LogonUser() successfully, it then call
DuplicateToken(token1, 3, token2)
The second parameter is defined as "SECURITY_IMPERSONATION_LEVEL", and have
SecurityAnonymous = 0SecurityIdentification = 1SecurityImpersonation = 2SecurityDelegation = 3
this call got Error 1346 (returned by Marshal.GetLastWin32Error()).
I had wrote an console to simulate those calls, and got the same result. If I passed "2"(SecurityImpersonation), it would return "true" with no error.
Running environment: Windows Server 2003 with all sp & patches.
Below is my parameter combinations for test and their results in a simulative console app:
dwLogonType ImpersonationLevel Resultfor LogonUser() for DuplicateToken()
3 3 False 3 2 True 2 3 True 2 2 True
According to MSDN, we have:
dwLogonType = 2 : LOGON32_LOGON_NETWORK = 3 : LOGON32_LOGON_NETWORK_CLEARTEXT
ImpersonationLevel = 2 : SecurityImpersonation = 3 : SecurityDelegation (has the most powerful privileges)
In consideration of the application security, I don't think the value "3" (LOGON32_LOGON_NETWORK_CLEARTEXT and SecurityDelegation) is a good parameter when calling the two platform APIs.
Copyright© 2008 Telligent Systems Inc. All rights reserved CommunityServer.com • Telligent.com