concept next code snippet in category spring

This is an excerpt from Manning's book Spring Security in Action.
When using the default UserDetailsService, a PasswordEncoder was also auto-configured. Because we overrode UserDetailsService, we also have to declare a PasswordEncoder. Trying the example now, you’ll see an exception when you call the endpoint. When trying to do the authentication, Spring Security realizes it doesn’t know how to manage the password and fails. The exception looks like that in the next code snippet, and you should see it in your application’s console. The client will get back an HTTP 401 Unauthorized and an empty response body.
Let’s create the project and add the needed dependencies. In my case, the name of the project is ssia-ch15-ex1-as. The next code snippet presents the dependencies we need to add. They are the same we also used in chapters 13 and 14 for the Authorization Server.
Because I’ll run both the Authorization Server and the Resource Server locally on the same machine, I need to configure a different port for this application. The next code snippet presents the content of the application.properties file.
server.port=9090 jwt.key=MjWP5L7CiDWe can now start our Resource Server and call the /hello endpoint using a valid JWT that you obtained earlier from the Authorization Server. You have to add the token to the Authorization HTTP header on the request prefixed by the word “Bearer”. The next code snippet shows you how to call the endpoint with curl.