With Identity in place, we can start to configure the settings of the library to meet our authentication requirements. The first place to start with configuring Identity to fit the needs of the project is in
Now that we are getting to configure our user, let’s check out the code in
Program.cs. Earlier you may have added the following:
This code is dictating the settings for account creation. Right now, for a user to create an account, they have to have the following:
- They have to click a link to confirm their account.
- Their password has to be more than 10 characters long.
- Their password has to include an uppercase letter(s).
- Their password does not have to include a number.
- Their password does not have to include a special character such as a question mark.
- Their password does not have to include lowercase letters.
These are just some basic requirements that can be changed to suit the needs of your application. For a full list of the default settings for users’ passwords and how we can change those settings, check out the documentation .
Program.cs, we can also configure cookie settings, password hashers, user validation requirements, sign in settings and more.
As you learn more about what Identity can do, you may find yourself wanting to customize it more and more to suit your needs! Here are some examples of what you can do with it.
- Customize user information
- Customize user roles
- Customize the UI
- Add new settings to user passwords
- Change the default settings around user sign-in
If you want to customize user data, it is best to do so when initially scaffolding the app. IdentityUser has a number of properties that are important and relevant to storing user data. However, when you read through the requirements you may notice that you need additional properties, such as the user’s first and last name. If you want to add custom properties, check out this article from Microsoft.