Starts in:
2 DAYS
11 HRS
51 MIN
25 SEC
Starts in:
2 D
11 H
51 M
25 S

Account Module

Account module implements the basic authentication features like login, register, forgot password and account management.

This module is based on Microsoft's Identity library and the Identity Module. It has IdentityServer integration (based on the IdentityServer Module) and OpenIddict integration (based on the OpenIddict Module) to provide single sign-on, access control and other advanced authentication features.

How to Install

This module comes as pre-installed (as NuGet/NPM packages). You can continue to use it as package and get updates easily, or you can include its source code into your solution (see get-source CLI command) to develop your custom module.

The Source Code

The source code of this module can be accessed here. The source code is licensed with MIT, so you can freely use and customize it.

User Interface

This section introduces the main pages provided by this module.

Login

/Account/Login page provides the login functionality.

account-module-login

Social/external login buttons becomes visible if you setup it. See the Social/External Logins section below. Register and Forgot password and links redirect to the pages explained in the next sections.

Register

/Account/Register page provides the new user registration functionality.

account-module-register

Forgot Password & Reset Password

/Account/ForgotPassword page provides a way of sending password reset link to user's email address. The user then clicks to the link and determines a new password.

account-module-forgot-password

Account Management

/Account/Manage page is used to change password and personal information of the user.

account-module-manage-account

OpenIddict Integration

Volo.Abp.Account.Web.OpenIddict package provides integration for the OpenIddict. This package comes as installed with the application startup template. See the OpenIddict Module documentation.

IdentityServer Integration

Volo.Abp.Account.Web.IdentityServer package provides integration for the IdentityServer. This package comes as installed with the application startup template. See the IdentityServer Module documentation.

Social/External Logins

The Account Module has already configured to handle social or external logins out of the box. You can follow the ASP.NET Core documentation to add a social/external login provider to your application.

Example: Facebook Authentication

Follow the ASP.NET Core Facebook integration document to support the Facebook login for your application.

Add the NuGet Package

Add the Microsoft.AspNetCore.Authentication.Facebook package to your project. Based on your architecture, this can be .Web, .IdentityServer (for tiered setup) or .Host project.

Configure the Provider

Use the .AddFacebook(...) extension method in the ConfigureServices method of your module, to configure the client:

context.Services.AddAuthentication()
    .AddFacebook(facebook =>
    {
        facebook.AppId = "...";
        facebook.AppSecret = "...";
        facebook.Scope.Add("email");
        facebook.Scope.Add("public_profile");
    });

It would be a better practice to use the appsettings.json or the ASP.NET Core User Secrets system to store your credentials, instead of a hard-coded value like that. Follow the Microsoft's document to learn the user secrets usage.

Contributors


Last updated: January 17, 2023 Edit this page on GitHub

Was this page helpful?

Please make a selection.

To help us improve, please share your reason for the negative feedback in the field below.

Please enter a note.

Thank you for your valuable feedback!

Please note that although we cannot respond to feedback, our team will use your comments to improve the experience.

In this document
Community Talks

What’s New with .NET 9 & ABP 9?

21 Nov, 17:00
Online
Watch the Event
Mastering ABP Framework Book
Mastering ABP Framework

This book will help you gain a complete understanding of the framework and modern web application development techniques.

Learn More