Handles user authentication and autherization
1.2K
Manages user authentication and autherization using web tokens
To setup the auth database, download and execute the auth.sql on the MYSQL server
With the auth database setup, start the Auth service with the command:
docker run --name some-auth-api -e AUTH_DB="mysqlusername:mysqlpassword@tcp(mysqlhost:mysqlport)/auth?charset=utf8" -d afindlator/auth-api:tag
Returns a refresh token to be used to request short lived access tokens based on username and password.
Url: /refreshtokens
Method: POST
Data Params:
{ "username": "myusername", "password": "mypassword" }
Success Response Code: 200
Success Response Body:(string) eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE0ODc1ODQ1MjUsImV4cCI6MTQ4NzY3MDkyNSwic3ViIjoicm9vdCIsImF1ZCI6InJlZnJlc2gifQ==.RX_tDZn44dWglb1wtmnyxXhOJbqV6UBwindQQ2i9vzQ=
Error Response Codes:
500 - Fatal error caused due to server faults
401 - Bad username or password
Returns an accesd token to be used to access published services.
Url: /accesstokens
Method: POST
Data Params:
{"app": "servicename", "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE0ODc1ODQ1MjUsImV4cCI6MTQ4NzY3MDkyNSwic3ViIjoicm9vdCIsImF1ZCI6InJlZnJlc2gifQ==.RX_tDZn44dWglb1wtmnyxXhOJbqV6UBwindQQ2i9vzQ="}
Success Response Code: 200
Success Response Body:(string) eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE0ODc1ODQ1MjUsImV4cCI6MTQ4NzY3MDkyNSwic3ViIjoicm9vdCIsImF1ZCI6InJlZnJlc2gifQ==.RX_tDZn44dWglb1wtmnyxXhOJbqV6UBwindQQ2i9vzQ=
Error Response Codes:
500 - Fatal error caused due to server faults
401 - Bad username or password
Content type
Image
Digest
Size
3.8 MB
Last updated
over 9 years ago
docker pull afindlator/auth-api