Token-based authentification microservice
You need to specify a connection to a mySQL database in your env. variables:
export VA_ENV = 'production' || 'local'
# database connection if VA_ENV is 'production'
export VQ_VA_DB = mysql://<user>:<password>@<host>:3306/<dbname>
# database connection if VA_ENV is 'local'
export VQ_VA_DB_TEST = mysql://<user>:<password>@<host>:3306/<dbname>
Sequelize library will create the DB tables if they do not exist the first time you start the server.
This API Endpoint is intended for validation of user's token. The token needs to be specified in 'x-viciauth-auth-token' header.
- Success Response:
Code: 200
Content:{ appId: 1, userId: 1, token: 'blablabla-some-token' }
Returns code with with one can restart user password.
- Data params:
'x-viciauth-api-key' and 'x-viciauth-app-key' headers required.
{
email: 'test@vq-labs.com',
}
-
Success Response:
Code: 200
Content:{ appId: 1, userId: 2, code: 'asdiu123nunoaHUi2' }
-
Error Response:
Code: 400
Content:{ code: 'EMAIL_NOT_FOUND' }
Allows authentification with password (local strategy).
- Data params:
'x-viciauth-api-key' and 'x-viciauth-app-key' headers required.
{
email: 'test@vq-labs.com',
password: 'super-secret'
}
-
Success Response:
Code: 200
Content:{ appId: 1, userId: 1, token: 'blablabla-some-token' }
-
Error Response:
Code: 400
Content:{ code: 'EMAIL_NOT_FOUND' }
- Data params:
{
email: 'test@vq-labs.com', // required
password: 'super-secret' // required
}
-
Success Response:
Code: 200
Content:{ appId: 1, userId: 1, token: 'blablabla-some-token' }
-
Error Response:
- Code: 400
Content:{ code: 'INITIAL_PARAMS' }
OR
- Code: 400
Content:{ code: 'EMAIL_EXISTS' }
- Code: 400
ExpressJS, Sequelize
adrianbarwicki[@]gmail.com
VQ-Labs
https://vq-labs.com/