Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6544665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:29:34+00:00 2026-05-25T11:29:34+00:00

After doing a chunk of reading about authenticating users (both here in SO land

  • 0

After doing a chunk of reading about authenticating users (both here in SO land and the internet generally), it seems fairly obvious that the “best” way to authenticate a user (and thus detect things like expired password, etc) is to call Win32 LogonUser(), rather than attempt to use PrincipalContext.ValidateCredentials in .NET.

However I’m not fully clear on though is what LogonUser actually does – and thus what overhead does it carry with it? The MSDN’s not entirely clear on this, the part that mostly concerns me is right at the end which says that LogonUser calls NPLoginNotify(), and it’s not entirely clear what this does (other than preparing logon scripts), nor what happens to the results of the call.

I was initially concerned that LogonUser loaded the user’s profile, but some further reading has put that concern to bed as a non-issue (unless I’m wrong on this one, but from what I can tell LogonUser never loads the profile – this would have to be explicitly loaded through a different function call).

The context for this is an intranet webapp that requires the ability to authenticate against active directory, so there will be a number of logins and logouts to the app: probably not that many initially, but may ramp significantly in the future. It seems that calling LoginUser with a type of LOGIN32_LOGIN_NETWORK and then immediately discarding the token that it gives me may be the best route forward.

Is there any overhead I’m not aware of, or am I just worrying unduly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:29:35+00:00Added an answer on May 25, 2026 at 11:29 am

    The MSDN page seems quite clear:

    The LOGON32_LOGON_NETWORK logon type is fastest, but it has the following limitations:

    The function returns an impersonation token, not a primary token. You cannot use this token directly in the CreateProcessAsUser function. However, you can call the DuplicateTokenEx function to convert the token to a primary token, and then use it in CreateProcessAsUser.

    If you convert the token to a primary token and use it in CreateProcessAsUser to start a process, the new process cannot access other network resources, such as remote servers or printers, through the redirector. An exception is that if the network resource is not access controlled, then the new process will be able to access it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After doing some reading about the Module Pattern, I've seen a few ways of
After doing a long search on stackoverflow i didn't find any one talked about
Context PHP 5.3.x Overview After doing a code-review with an associate who uses both
After doing some search here, I found next to no questions on developing a
After doing an import of a content type (fairly large), the Apache SOLR admin
After doing some reading, I've found that you can customize the text and color
After doing some work with Ruby, Rails, and RSpec last summer and I learned
After doing a project with WPF and getting very much attached to it's excellent
After doing a subversion merge with a co-worker, my VSeWSS project no longer build
After doing some research on the subject, I've been experimenting a lot with patterns

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.