This is a NodeJS API that supports username and password authentication with JWTs.
You can do a POST to /sessions/create
to log a user in.
The body must have:
username
: The usernamepassword
: The password
It returns the following:
{
"id_token": {jwt}
}
The JWT is signed with the secret located at the config.json
file. That JWT will contain the username
and the roles hard-coded in user-routes.js
You can do a GET to /api/protected
to ensure your token is valid. It returns an empty 200
response if the token is still valid.
This project is licensed under the MIT license. See the LICENSE file for more info.