Database as IdentityStore

Get a brief introduction to Database as IdentityStore with a code example.

Overview

In this lesson, we will use the database to store user credentials and the key derivation function to hash the password. Hashing is required with the Security API so that stored passwords are protected.

Create the project

We start from the project template we defined earlier and add the required dependencies and classes.

If you want to work within the Educative platform, simply use the project we’ve created at the end of this lesson. If you choose to work locally, you will need to create a Maven project db as described in "Introduction to Window Shopping."

In our case, no additional dependencies are needed.

Configure the security

We need to configure the authentication mechanism and the IdentityStore. Although we could use any method we’ve covered in the course so far, we’ll use Basic authentication once again.

Get hands-on with 1400+ tech skills courses.