Skip to main content
.NET 6.0+

DevExpress v24.1 Update — Your Feedback Matters

Our What's New in v24.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

AuthenticationActiveDirectory.CreateUserAutomatically Property

Specifies whether a user is created automatically for the Windows account used to run the application.

Namespace: DevExpress.ExpressApp.Security

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

#Declaration

public bool CreateUserAutomatically { get; set; }

#Property Value

Type Description
Boolean

true, if a user is created automatically for the Windows account used to run the application; otherwise - false.

#Remarks

Although the default value of this property is false, it is changed to true in a solution template. When UI-level security is used, you can change this property value in the Application Designer.

Security_CreateUserAutomatically

When the Middle Tier security is used, change this property value in the following manner.

AuthenticationActiveDirectory authentication = new AuthenticationActiveDirectory();
authentication.CreateUserAutomatically = false;
QueryRequestSecurityStrategyHandler securityProviderHandler = delegate() {
    return new SecurityStrategyComplex(typeof(ApplicationUser), 
        typeof(PermissionPolicyRole), authentication);
};

The SecurityStrategyComplex.NewUserRoleName property specifies the Role that is associated with auto-created users.

You can customize the process of user auto-creation by handling the AuthenticationActiveDirectory.CustomCreateUser event.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CreateUserAutomatically property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also