A service to providing the authentication feature such as:
- Register flow
- Facebook Oatuh2 flow
- Google Oauth2 flow
Additionally, this server also contains the coupon management and email sending feature.
This server is a server providing the feature handler and gateway. Here are the APIs:
API NAME | URL | Method | Description | Request | Response | |
---|---|---|---|---|---|---|
Healthcheck | /ping | GET | Healthcheck endpoint. Response message when server alive. | N/A | 200:
{"message": "pong"}` |
|
Register | /register | POST | Register a new user, if user already register than response the JWT token only |
{
"username": "Lucas",
"email": "chucobo5219@gmail.com",
"password": "klasdfjvier123"
}
|
200:
{
"Token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VybmFtZSI6Ikx1Y2FzIiwiZXhwIjoxNTg3NTcxNDYzfQ.KxKRNYmS6Q-07JZNIpNYNyjXJ9p1l6bacBAcp94zPDc"
}
502:
{
"error": "Username is require in request body"
}
502:
{
"error": "the password should contains at lease 8 charactor"
}
502:
{
"error": "incorrect email ex: 1234@domain.com current input:chucobo5219gmail.com"
}
|
|
Get google oauth url | /get_googleoauth_url | GET | Get google oauth login endpoint | N/A | 200:
{
"url": "https://accounts.google.com/o/oauth2/auth?client_id=253768931865-or5h985g6ftkljaeqd8obveq2eod4a2i.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Famazingtalker.herokuapp.com%2Fgoogleoauth&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&state=state"
}
|
|
Get facebook oauth url | /get_facebookoauth_url | GET | Get facebook oauth login endpoint | N/A | 200:
{
"url": "https://www.facebook.com/v3.2/dialog/oauth?client_id=3043148599098072&redirect_uri=https%3A%2F%2Famazingtalker.herokuapp.com%2Ffacebookoauth&response_type=code&scope=public_profile+email&state=state"
}
|
To passing the oauth, we need to get the oauth url and the Oauth2 process is passing if the token can get the user profile. The user profile is getting from oauth provider server. When profile is invalid. The error message is responded.