Xafari Security. Authentication

Xafari Security provides two additional types of authentication: XafariAuthenticationActiveDirectory and XafariAuthentication.

XafariAuthenticationActiveDirectory is analogous AuthenticationActiveDirectory, and, in addition, it provides searching user name in a different context. Contexts to search user name is described below in details.

Note

Web projects requires to configure IIS and set Windows authentication. If it is required, you can use ASP.NET Impersonation (see https://msdn.microsoft.com/en-us/library/134ec8tc.aspx, https://technet.microsoft.com/en-us/library/cc730708(v=ws.10).aspx).

XafariAuthentication includes AuthenticationStandard and XafariAuthenticationActiveDirectory, it allows the end-user specify the authentication type directly in runtime. This type exposes AllowEmptyPasswords propety, it is possible to set this property via the AllowEmptyPasswords key in config-file.

The image below shows Xafari Authentication logon windows.

Windows Forms:

security_authentication_1

ASP.NET:

security_authentication_2

The authentication type must be specified when configuring Security System, this tasks are described in DC Security and XPO Security topics.

Context

Context is required when using XafariAuthenticationActiveDirectory or AuthenticationTypes.ActiveDirectory variant of the XafariAuthentication. The context suggests the framework where to find the user.

To set Context use XafariAuthenticationActiveDirectory.ContextAllowed static property. Valid values are contained in the Xafari.Security.XafariAuthenticationContextAllowed enumeration, are as follows:

  • Xafari.Security.XafariAuthenticationContextAllowed.ThreadWindowsIdentity: to obtain user name from the current WindowsIdentity.
  • Xafari.Security.XafariAuthenticationContextAllowed.HttpContext: to obtain user name from the current HttpContext.
  • Xafari.Security.XafariAuthenticationContextAllowed.ServiceSecurityContext: to obtain user name from the current ServiceSecurityContext.
  • Xafari.Security.XafariAuthenticationContextAllowed.All: search for the user name consistently in all the above places.

The default values are different for Web and Win applications, it is XafariAuthenticationContextAllowed.HttpContext and XafariAuthenticationContextAllowed.ThreadWindowsIdentity correspondingly.