Now, it is time to test security with Postman. Start the application and try to create a new user in the same way as before:
Unauthorized when trying to create a new user without authentication
Since you are not authenticated, you are not allowed to create a new user. Go to the Robomongo application and insert a new user manually with the following content:
{
"username" : "John",
"firstName" : "John",
"lastName" : "Doe",
"email" : "[email protected]",
"password" : "$2b$10$Z3YAyoIfLCniGw9T63TIpehihJKUIdDVNZ8tfdUZQNRJqQ15E.o9i",
"phone" : "5555555",
"userStatus" : 1
}
Now, go back to Postman and call the login, as follows:
Getting a JWT token from the login
The output from the login operation is a JWT token. You can...