This project is an ASP.NET Core 8 application that provides identity and authentication features. It includes an implementation for the IEmailSender
interface using SendGrid
, external login providers templates, custom properties for ApplicationUser
, QR code generation for 2FA and structured logging with Serilog
. The application is designed to be easy to configure and run, with an SQLite
database, so no additional database setup is required.
This project starts with boilerplate code for ASP.NET Core Identity and includes custom implementations for various features:
- Integrated
SendGrid
to send confirmation emails and password reset emails. - Configured external login options with
Microsoft
,Google
,Facebook
, andTwitter
. - Custom profile data handling for
ApplicationUser
. - Automatically assigns roles and seeds the database with default values, including an admin user.
- Generates QR codes for two-factor authentication (2FA) using the
QRCoder
library. - Implemented
Serilog
for logging.
Below are some screenshots showcasing the various features of the project. These images provide a glimpse into the functionality and user interface, allowing you to see what the project offers before downloading and running it.
External Service Login And Register
To enable email sender and external login providers, you will need to configure the following:
-
SendGrid API Key:
Sign up for a SendGrid Account and obtain an API key. Then, add your SendGrid API key in
appsettings.json
:"EmailSettings": { "ApiKey": "YourSendGridApiKey", "FromAddress": "[email protected]", "FromName": "Your Name" }
-
External Login Providers:
To use external login options (Microsoft, Google, Facebook, Twitter), you need to register your application with these providers and obtain the necessary credentials. Add these credentials in
appsettings.json
:"AuthSettings": { "Microsoft": { "Key": "YourMicrosoftClientId", "Secret": "YourMicrosoftClientSecret" }, "Google": { "Key": "YourGoogleClientId", "Secret": "YourGoogleClientSecret" }, "Facebook": { "Key": "YourFacebookAppId", "Secret": "YourFacebookAppSecret" }, "Twitter": { "Key": "YourTwitterConsumerKey", "Secret": "YourTwitterConsumerSecret" } }
For more details on how to configure these providers, refer to this article.