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:
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?
if 1 true, httpcontext.user property set initially?
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
Post a Comment