Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

AuthenticationStandard Class

An Authentication that assumes an interactive logon. A user inputs logon parameters (e.g. user name and password) manually via the logon dialog.

Namespace: DevExpress.ExpressApp.Security

Assembly: DevExpress.ExpressApp.Security.v22.1.dll

Declaration

[ToolboxTabName("DX.22.1: XAF Security")]
public class AuthenticationStandard :
    AuthenticationBase,
    IAuthenticationStandard,
    ISupportChangePasswordOption

Remarks

When the AuthenticationStandard authentication is in use, the logon Window displays a Detail View of an AuthenticationStandardLogonParameters type object. This object has two string properties: UserName and Password. The UserName property is used to find the corresponding user in the database. Logging on to the application is not allowed if the user is not found or the specified password is wrong. The AuthenticationStandard object works only with objects of the AuthenticationStandardLogonParameters type or its descendants.

Logon Window in a WinForms Application

Logon Window in a WinForms Application

Logon Window in an ASP.NET Web Forms Application

Logon Window in an ASP.NET Web Forms Application

Logon Window in an ASP.NET Core Blazor Application

Logon Window in an ASP.NET Core Blazor Application

You can enable the AuthenticationStandard authentication in code. It is required to instantiate the AuthenticationStandard class and pass this instance to the SecurityStrategyComplex constructor. Then, the created security strategy object should be assigned to the XafApplication.Security property. In a Windows Forms application project, modify the Program.cs (Program.vb) file in the following manner.

public static void Main(string[] arguments) {
    MySolutionWinApplication winApplication = new MySolutionWinApplication();
    winApplication.Security = 
        new SecurityStrategyComplex(typeof(PermissionPolicyUser), typeof(PermissionPolicyRole), 
            new AuthenticationStandard());
    // ...
}

In an ASP.NET Web Forms application project, modify the Global.asax.cs (Global.asax.vb) file in the following manner.

protected void Session_Start(Object sender, EventArgs e) {
    WebApplication.SetInstance(Session, new MySolutionAspNetApplication());
    WebApplication.Instance.Security = 
        new SecurityStrategyComplex(typeof(PermissionPolicyUser), typeof(PermissionPolicyRole), 
            new SecurityDemoAuthentication());
    // ...
}

In a Blazor application project, modify the Startup.cs file in the following manner.

using DevExpress.ExpressApp.Security;
using DevExpress.Persistent.BaseImpl.PermissionPolicy; // for XPO
using DevExpress.Persistent.BaseImpl.EF.PermissionPolicy; // for EF Core
using Microsoft.Extensions.DependencyInjection;
// ...
namespace MySolutionName.Blazor.Server {
    public class Startup {
        // ...
        public void ConfigureServices(IServiceCollection services) {
            // ...
            services.AddXaf<MySolutionNameBlazorApplication>(Configuration);
            services.AddXafAspNetCoreSecurity(Configuration, options => {
                options.RoleType = typeof(PermissionPolicyRole);
                options.UserType = typeof(PermissionPolicyUser);
                // in XPO applications, install the DevExpress.ExpressApp.Security.AspNetCore.Xpo NuGet package
                // and uncomment the following line:
                // options.Events.OnSecurityStrategyCreated = securityStrategy => ((SecurityStrategy)securityStrategy).RegisterXPOAdapterProviders();
                options.SupportNavigationPermissionsForTypes = false;
            })
            .AddAuthenticationStandard(options => {
                options.IsSupportChangePassword = true;
            });
            services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(options => {
                options.LoginPath = "/LoginPage";
            });
        }
        // ...
    }
}

In .NET Framework applications, you can also enable the AuthenticationStandard authentication in the Application Designer. To do this, invoke the designer and drag the AuthenticationStandard component from the ToolBox‘s DX.22.1: XAF Security page to the designer’s Security pane.

Security_DesignerAuthenticationSimple

If the server-side security is used, refer to the Middle Tier Security topic to see how to enable the AuthenticationStandard authentication.

See Also