User Authentication using a Logon Window in Windows Forms Applications
- 11 minutes to read
This topic details the steps performed from the time the WinApplication object has been created and initialized, until the moment an end user has been authenticated to the application. There are two built-in Authentication Strategies in XAF. The AuthenticationStandard authenticates end users with the information typed in the logon window. The AuthenticationActiveDirectory does not require the logon window to be displayed. It takes the required information from the system’s active directory. This topic details how end users are authenticated when the built-in AuthenticationStandard strategy is used. To learn what steps are taken when the built-in AuthenticationActiveDirectory strategy is used, refer to the User Authentication Without a Logon Window in Windows Forms Applications topic. You can customize the AuthenticationActiveDirectory, so that a logon window is displayed and the information typed in it is used for authentication. In this instance, read this topic to learn how the logon window is displayed.
#Create a Logon View
Stage Description | Ways to Interfere |
---|---|
A Detail View is created by the information stored in the Application Model‘s Views | <Logon | If you require that custom information is requested in the logon window, specify a custom Logon By default, an object of the specified Logon By default, the values specified by an authenticated user are saved to the Settings You can access the Logon You can customize the Detail View representing the Logon |
#Create a Logon Window
Stage Description | Ways to Interfere |
---|---|
Before creating an instance of the Window class, the required Controllers are created. | If you need to add custom buttons to the logon window, or customize the behavior of the default ones, implement a custom Dialog Controller by inheriting from the Logon By default, only the Controllers that are sufficient for the logon window are created. You can create extra Controllers. To do this, handle the Xaf Subscribe to the Controller. |
Then, a Window is created and all the created Controllers are registered in it. This means that their Window | Subscribe to the Controller. |
The Controllers that represent the Window | To activate a Window Controller for the Logon Window only, add an item to the Controller. Override a Controller’s Window Subscribe to the Controller. |
#Assign a Template to the Window
Stage Description | Ways to Interfere |
---|---|
To be visualized, the Logon Window creates a Template, a control (e. | Subscribe to the Xaf Use a custom Frame Template Factory to create custom Templates. Register the required Frame Template Factory in a module where the custom Templates are implemented. In this instance, the module should be added to an application to use the custom Templates. For details, refer to the How to: Distribute Custom Templates with Modules topic. |
When a Template is created, all its Action Containers are created as well. Action Containers are the controls that display Actions. The Popup | Subscribe to the Xaf |
The created Template is assigned to the Window. |
#Create Controls for Actions
Stage Description | Ways to Interfere |
---|---|
The Window’s Template |
Subscribe to the Frame. |
#Assign the View to the Window
Stage Description | Ways to Interfere |
---|---|
The created View is assigned to the Logon Window. | Subscribe to the Frame. |
#View Controllers are Activated
Stage Description | Ways to Interfere |
---|---|
View Controllers from the Logon Window’s Frame. | You can manage the activation of a View Controller using the following properties: View Override a Controller’s View Subscribe to the Controller. |
#Assign the Window’s View to the Template
Stage Description | Ways to Interfere |
---|---|
The View is assigned to the current Window’s Template. This forces the creation of the View’s control (see View. | Handle the View. |
The Template’s ISupport | By default, the Template’s settings are saved to the Application Model‘s Templates | Template node. You can save them to another Application Model node. For this purpose, override the Get You can save the Template’s settings in another store. To do this, implement a custom Template, overriding the methods exposed by the IFrame |
The Template is shown. |
#Authentication
Stage Description | Ways to Interfere |
---|---|
To start the authentication process, an Object Space (see Base | Before the authenticating process is started, you can access the Logon You can perform a custom process of checking the database and application compatibility. For this purpose, handle the Xaf If you do not need the scenario implemented in the Xaf Use the Xaf |
Authentication is accomplished after an end user clicks Log In in the logon window. When the Authentication | If the default authentication performed by a built-in Authentication class does not satisfy your requirements, implement a custom class. For instance, inherit from one of the built-in authentication classes: Authentication You can access the Logon To create a custom User Model Differences Store, handle the Xaf |
The system gives end users three attempts to log on to the application. After the third attempt, a user-friendly exception is raised. | To change the three attempt scenario, override the Logon method in your Win |
The Application Model’s layer with end user customizations, stored in the Model. | To access the Logon |