See Also:
Security - provide the "Register" and "Forgot Password" actions and pages
Proposed Solution:
Add an option to add Auto-Register Form and Forgot Password Form in XAF Web apps.
Security.Authentication - provide a "Forgot Password" feature
Answers
Hi,
I want to close this ticket for now, as we will unlikely implement this in the near future as this is a low priority for us because of the following reasons:
- It is already possible to accomplish this task using the current framework capabilities;
- It is difficult to provide a generic solution for this task that meets everyone's needs, as there are many people who implemented custom security classes tailored to their own needs and business processes;
We provide two examples that show how to approach this task in an XAF ASP.NET WebForms app:
How to: Use Google, Facebook and Microsoft accounts in ASP.NET XAF applications (OAuth2 authentication demo)
How to manage users (register a new user, restore a password, etc.) from the logon form in ASP.NET.
We recommend the first example over the second one as authentication providers like Office 365 or G Suite already have the "forgot password" and related features built-in (learn more: one, two) and you will just need to link them to your XAF app.
I hope you find this information helpful.
Although the How to manage users (register a new user, restore a password, etc.) from the logon form in ASP.NET example was marked as obsolete, the approaches demonstrated in it can be used in the current version as well. The Reset Password functionality can be implemented fairly easy. It is sufficient to implement the following steps:
- Add an action to the logon form - see How to add a custom action on the logon window, Activate a Controller for the Logon Form.
2. Show a custom dialog when this action is executed - see Ways to Show a View, Non-Persistent Objects.
I have attached a modified version of the e4037 example. I have replaced outdated classes and removed the user creation functionality. Note that this example contains some legacy code which is not required for the Reset Password button.
Hello,
We don't have the built-in 'forgot password' feature in our Security System, but we have the following example that illustrates how to create this functionality using custom actions: E4037 - How to manage users (register a new user, restore a password, etc.) from the logon form in ASP.NET. We haven't tested this solution with Blazor yet, we designed it as platform-independent, and it should work with Blazor as well. Try converting this solution in .NET Core and then integrate it.
Please let us know if this solution addresses your requirements. Alternatively, use a simpler way that Anatol described above. It is not so generic as the example's code, but it's much easier to implement.
Thanks,
Andrey