- RESTful APIs running on
localhost:8085
- gRPC API running on
localhost:50050
POST
/login/google
(Login with Google)
key |
required |
data type |
description |
idToken |
true |
string |
Id token from Google |
http code |
content-type |
response |
200 |
application/json |
{"name": "username", "email": "user@ex.com", "avatar": "http://avatar.com", "refreshToken": "refreshToken"} |
401 , 500 |
text/plain |
N/A |
Upon successful login, a cookie named accessToken
will be set with HttpOnly and Secure flag.
POST
/login/credentials
(Login with credentials)
key |
required |
data type |
description |
mail |
true |
string |
N/A |
pass |
true |
string |
N/A |
http code |
content-type |
response |
200 |
application/json |
{"name": "username", "email": "user@ex.com", "avatar": "http://avatar.com", "refreshToken": "refreshToken"} |
401 |
text/plain |
N/A |
Upon successful login, a cookie named accessToken
will be set with HttpOnly and Secure flag.
POST
/register
(Register with mail and password)
key |
required |
data type |
description |
name |
true |
string |
N/A |
email |
true |
string |
N/A |
password |
true |
string |
N/A |
avatar |
false |
string |
Avatar's image URL |
http code |
content-type |
response |
200 |
text/plain |
N/A |
401 , 500 |
text/plain |
N/A |
POST
/refresh
(Generate a new refresh token)
key |
required |
data type |
description |
refreshToken |
true |
string |
N/A |
http code |
content-type |
response |
200 |
application/json |
{"name": "username", "email": "user@ex.com", "avatar": "http://avatar.com", "refreshToken": "refreshToken"} |
400 , 401 , 500 |
text/plain |
N/A |
Upon successful refresh, a cookie named accessToken
will be set with HttpOnly and Secure flag.
The auth-service also expose the functionality the generate and verify the JWT tokens.
GET
/verify
(Verify a existing JWT token)
key |
required |
data type |
description |
token |
true |
string |
Starts with Bearer<space> |
// Stringified string (Use `JSON.parse()` to parse the string):
{"UserMail":"dev@dev.com","UserName":"dev","exp":1722324402,"iat":1722238002}
key |
data type |
description |
claims |
string |
Stringified JSON data (Empty string if it's expired) |
expired |
bool |
N/A |
status code |
response |
UNKNOWN 2 , INTERNAL 13 |
Invalid token |
INTERNAL 13 |
Marchal failed |