The user areas sample solution contains two projects:
- AuthenticationSample: A standard credential-based authentication flow with account recovery and account management features.
- RegistrationAndVerificationSample: A self-service user registration and account verification flow.
The authentication sample is written using ASP.NET Razor Pages and implements the following features:
- Credential-based authentication (email addresses as usernames)
- Sign in/sign out
- Forcing a password change at first sign in
- Account recovery (AKA "forgot password")
- Custom mail templates
- Account management (update, password change, delete)
- Using
ICofoundryHelper
in views to query the current user
In this sample users are added via the admin panel.
- Create a database named 'Cofoundry.Samples.UserAreas.AuthenticationSample' and check the Cofoundry connection string in the appsettings.json file is correct for your SQL Server instance
- Run the website and navigate to "/admin", which will display the setup screen
- Enter an application name and setup your user account. Submit the form to complete the site setup.
- Sign into the admin panel
- Navigate to Settings > Member Users to create a user
- Adding a user will send an email notification to the user with a temporary password.
- The test site is configured to write out debug emails into the
/App_Data/Emails
folder, open the email file to find the temporary password for your user account. - Follow the link on the homepage or navigate to "/members/" to sign in.
The registration and verification sample is written using ASP.NET MVC and implements the following features:
- Self-service user account registration
- User accounts verified by email
- Re-sending verification emails
- Custom user verification mail template
- Credential-based authentication (separate username and email address)
- Sign in/sign out
- Using
ICofoundryHelper
in views to query the current user
- Create a database named 'Cofoundry.Samples.UserAreas.RegistrationAndVerificationSample' and check the Cofoundry connection string in the appsettings.json file is correct for you SQL Server instance
- Run the website and navigate to "/admin", which will display the setup screen
- Enter an application name and setup your user account. Submit the form to complete the site setup.
- From the homepage navigate to Members > Register here or go directly to "/members/registration".
- Fill in the and submit the form.
- Adding a user will send an email notification to the user with a verification link.
- The test site is configured to write out debug emails into the
/App_Data/Emails
folder, open the email file to find the verification link. - Copy the link into your browser, navigating to the link will verify the account.
- Follow the "sign in" link to sign in to your new account.