c# - Where is HttpContext.User property set initially? -


httpcontext has user property treats iprincipal type. documentation of ms know property might set http-modules such windowsauthenticationmodule or formsauthenticationmodule but, example, code of windowsauthenticationmodule:

 windowsprincipal user = context.user windowsprincipal;         if (user != null) {/* code... */} 

it's interesting if condition false (user null or user has other type, not windowsprincipal) windowsauthenticationmodule return control (for intagrated mode pipeline of iis). have following questions:

  1. after iis authenticates client (as anonymous or authenticated user, configured) pass security token asp.net. our application in case wrapps token in windowsidentity и windowsprincipal objects. happens before authentication modules begin implementing. true?

  2. if 1 true, httpcontext.user property set initially?

  3. if 1 true, when httpcontext.user null? guess it's might if configure web.config :

    < authentication mode="none" />

am right?

in cases, httpcontext.user set when user authenticated (not anonymously). know in formsauthentication happens on formsauthentication.setauthcookie , httpcontext.user set null when client logs out , cookie cleared


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -