This example demonstrates how to customize standard authentication behavior and supply additional logon parameters in XAF applications. The default login form displays User Name and Password editors. This sample customizes the login form to show Company and Application User lookup editors instead of User Name.
- Define a Company class that contains company names. This class should contain a list of
ApplicationUser
objects as a part of a one-to-many relationship. Add the second part of this relationship to the ApplicationUser class generated by the Solution Wizard. Finally, add theCompany
class to your application’s DbContext. - Create a custom logon parameter class that uses the
Company
class. To see an example, refer to the following file - [CustomLogonParameters.cs]. - Implement [custom authentication] that uses custom logon parameters.
- Implement a custom [authentication provider] that creates an instance of the custom authentication strategy.
- Pass custom classes to the Security System. To see an example, refer to the following file - Startup.cs.
- Add demo data.
- Generate a demo database.
- Run the application.
For detailed instructions, refer to the following topic: Customize Standard Authentication Behavior and Supply Additional Logon Parameters (Blazor).
For detailed instructions, refer to the following topic: Customize Standard Authentication Behavior and Supply Additional Logon Parameters (WinForms & ASP.NET Web Forms).
- Company.cs
- [CustomLogonParameters.cs]
- [CustomAuthentication.cs]
- [CustomAuthenticationStandardProvider.cs]
- Customize Standard Authentication Behavior and Supply Additional Logon Parameters (Blazor)
- Customize Standard Authentication Behavior and Supply Additional Logon Parameters (WinForms & ASP.NET Web Forms)
- XAF ASP.NET Web Forms - Use OAuth2 Authentication Providers
- Role-based Access Control, Permission Management, and OData / Web / REST API Services for Entity Framework and XPO ORM
(you will be redirected to DevExpress.com to submit your response)