WIN32 Login

We developed the ASP.NET 3.5 web application with the 2008 web server and implemented a special authentication solution using the active directory as a credential store. Our foreground application uses the usual login form to register a username and password and uses the Win32 LogonUser method to authenticate user credentials. When we call the LogonUser method, we use LOGON32_LOGON_NETWORK as the input type.

The problem we discovered is that user profile folders are created in the C: \ Users folder of the web server. It seems that the folder is created when a new user who has never been registered before is registered for the first time. As the number of new users registering in the application increases, disk space decreases due to the large number of new user folders being created.

I need to return the token after authentication (authenticated \ password is blocked \ wrong password), its further use and based on the logic that displays different web pages

Has anyone seen this behavior using the Win32 LogonUser method?

Please answer the following problem:

Is it possible to disable this behavior to create a folder that occupies 2.78 MB of space for each new user, and it eats my space?

I tried LOGON32_LOGON_BATCH, but it gave error 1385 in user authentication. For any solution related to LOGON32_LOGON_BATCH, can you confirm that this will stop creating folders in the location C: \ users.

Also for any possible solution I need either

I can disable the folder that will be created in C: \ user or Any other option for an authenticated user who will not create folders.

+3
source share
3 answers

LOGON32_LOGON_BATCH .

+4

MSDN LogonUser LOGON32_LOGON_BATCH -:

, . , -. LogonUser .

?

+2

(.NET, Windows Server, ), . , , . ? .

1385 (ERROR_LOGON_TYPE_NOT_GRANTED) (. http://support.microsoft.com/kb/155012/en):

, . , .

SE_BATCH_LOGON_NAME SE_DENY_BATCH_LOGON_NAME (NTSecAPI.h), / (. http://msdn.microsoft.com/en-us/library/bb545671%28VS.85%29.aspx ). Process Explorer (. http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx), , (. "" "). , , SE_BATCH_LOGON_NAME, LogonUser, .

, . SSPI (. http://support.microsoft.com/kb/180548/en), LogonUser. , the most smart and quick way , .

" SSPI" (. http://alt.pluralsight.com/wiki/default.aspx/Keith.GuideBook/HowToGetATokenForAUser.html) SSPI .NET 2.0.

+1

Source: https://habr.com/ru/post/1745370/


All Articles