ASP.NET main body and identification object implementation

xiaoxiao2021-03-06  61

Summary

The main object implements the iprincipal interface and represents a particular user (code represents the user's operation) security context. The subject object includes any role that the user's identity (as included IIDENTITY object) and the user belongs.

ASP.NET provides the following main body and identification object implementation:

• WindowsPrincipal and WindowsidentIndity objects indicate users who have authenticated identity using Windows authentication. For these objects, you can automatically get a list of roles from the Windows group of Windows users. • GenericPrincipal and GenericIdentity objects indicate users that have authenticated identity using Form authentication or other custom authentication mechanisms. For these objects, the role list is obtained in a custom manner (usually obtained from the database). • The FormSidentity and PassportIndIndEntity objects indicate users who have authenticated identity using Form authentication and Passport authentication.

The following tables illustrate the results identified from the Save IPrincipal and / or IIDENTITY objects within the range of IIS authentication settings. The following depot words are used in the table:

• httpContext = httpContext.current.user, which returns an iPrincipal object that contains security information that is currently a Web request. This is the authenticated web client. • WindowsIdentity = WindowsIdentity.getCurrent (), which returns the identity of the security context of the currently executed Win32 thread. • Thread = Thread.currentPrincipal, it returns the main body of the currently executed .NET thread (above Win32 thread).

Back to top

IIS anonymous authentication

Web.config setting variable position result identifier HttpContext WindowsIdentityThread -MACHINE / IUSR_MACHINE- HttpContextWindowsIdentityThread -MACHINE / ASPNET- name name MACHINE / IUSR_MACHINE HttpContextWindowsIdentityThread user's user-supplied HTTPCONTEXTWINDOWSIDENTITYTHREAD user supplied name Machine / ASPNET user

Back to top

IIS basic authentication

Web.config Settings Variable Location Results HTTPCONTEXTWINDOWSIDENTITYTHREAD Domain / User Domain / User Name / User Name HttpContextWindowsIdentityThread domain / username MACHINE / ASPNET domain / username name of the name of the domain HttpContextWindowsIdentityThread users / user name provided by the user HTTPCONTEXTWINDOWSIDENTITYTHREAD users provide names Machine / ASPNET user supplied Name Back to top

IIS Summary Authentication

Web.config Settings Variable Location Results HTTPCONTEXTWINDOWSIDENTITYTHREAD Domain / User Domain / User Name / User Name HttpContextWindowsIdentityThread domain / username MACHINE / ASPNET domain / username name of the name of the domain HttpContextWindowsIdentityThread users / user name provided by the user HTTPCONTEXTWINDOWSIDENTITYTHREAD User's name provided by Machine / ASPNET users

Back to top

IIS integrated Windows

Web.config Settings Variable Location Results HTTPCONTEXTWINDOWSIDENTITYTHREAD Domain / User Domain / User Name / User Name HttpContextWindowsIdentityThread domain / username MACHINE / ASPNET domain / username name of the name of the domain HttpContextWindowsIdentityThread users / user name provided by the user HTTPCONTEXTWINDOWSIDENTITYTHREAD users provide names Machine / ASPNET user supplied Name Back to top

转载请注明原文地址:https://www.9cbs.com/read-118853.html

New Post(0)