-
Notifications
You must be signed in to change notification settings - Fork 0
Authen API
Nattapon Rattajak edited this page Jul 26, 2018
·
13 revisions
POST /api/v1/auth/registerOrLogin/microsoftAD
Field | Description | Optional |
---|---|---|
JWTToken |
Login Microsoft Azure ADB2C | No |
Note Register setup default
User -> roles = ["user"]
<!-- User -> authenTypeId = 1 -->
Player -> playerName = "undefined"
Player -> teamPlayerId = -1
Player -> coin = 500
Player -> diamond = 0
Player -> costumeSelectId = -1
{
"data": {
"exp": 1529053383,
"nbf": 1529049783,
"ver": "1.0",
"iss": "https://login.microsoftonline.com/89a75cd7-6526-4f3f-8dea-0bdce25494e8/v2.0/",
"sub": "a459b3bb-3c13-483b-9fbd-3d7b61c76cf0",
"aud": "4c6b5f37-92ad-4efe-87f7-faf5b6912648",
"nonce": "defaultNonce",
"iat": 1529049783,
"auth_time": 1529049783,
"given_name": "tanarat",
"family_name": "u-jaleankid",
"name": "",
"idp": "live.com",
"oid": "",
"emails": [
"sa_leesoft@hotmail.com"
],
"tfp": "B2C_1_BOBO-POL"
},
"isSuccess": true
}
POST /api/v1/auth/registerOrLogin/facebook
Field | Description | Optional |
---|---|---|
authenToken |
Facebook user access token | No |
Note Register setup default
User -> roles = ["user"]
User -> authenTypeId = 1
Player -> playerName = "undefined"
Player -> teamPlayerId = -1
Player -> coin = 500
Player -> diamond = 0
Player -> costumeSelectId = -1
{
"data": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Im5hdHRhcG9uLnJAbGl2ZS5jb20iLCJpZCI6IjViMmNhODgxYmRmZGQ4NGYxZmE1ZmU0MCIsImV4cCI6MTUyOTc0MDA1NSwiaWF0IjoxNTI5NjUzNjU1LCJpc3MiOiJhaG9vLXN0dWRpby5jby50aCJ9.NXuT7_IH8ScQI9riJpkO0fHZ_3OjUFyS80Ua_vHS0q4",
"isSuccess": true
}
POST /api/v1/auth/registerOrLogin/google
More details (Google identity platform)
Field | Description | Optional |
---|---|---|
authenToken |
google user access token | No |
Note Register setup default
User -> roles = ["user"]
User -> authenTypeId = 1
Player -> playerName = "undefined"
Player -> teamPlayerId = -1
Player -> coin = 500
Player -> diamond = 0
Player -> costumeSelectId = -1
{
"data": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Im5hdHRhcG9uLnJAbGl2ZS5jb20iLCJpZCI6IjViMmNhODgxYmRmZGQ4NGYxZmE1ZmU0MCIsImV4cCI6MTUyOTc0MDA1NSwiaWF0IjoxNTI5NjUzNjU1LCJpc3MiOiJhaG9vLXN0dWRpby5jby50aCJ9.NXuT7_IH8ScQI9riJpkO0fHZ_3OjUFyS80Ua_vHS0q4",
"isSuccess": true
}
POST /api/v1/auth/login
Field | Description | Optional |
---|---|---|
- | No | |
password | - | No |
{
"data": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Im5hdHRhcG9uLnJAbGl2ZS5jb20iLCJpZCI6IjViMzA2ZGJkYmRmZGQ4NGYxZmFlOGI0MCIsImV4cCI6MTUzMDE1ODY0NiwiaWF0IjoxNTMwMDcyMjQ2LCJpc3MiOiJuYXR0YXBvbi5yQGxpdmUuY29tIn0.XghHHAg5qKRLqYuQ7g7Y7qolT4YeAlbwJrQcGDp1AHQ",
"isSuccess": true
}
POST /api/v1/auth/register
Field | Description | Optional |
---|---|---|
- | No | |
password | - | No |
{
"data": {
"message": "Verification email will send to you as rattajak.n3@gmail.com",
"secret": "SVDlTh5deIzbyOHHyT3bl5CmfRfwvViVbR-mHSk-QtXheDE5Jg==",
"success": true
},
"isSuccess": true
}
GET /api/v1/auth/refreshToken
Field | Description | Optional |
---|---|---|
Authorization |
Access token | No |
{
"data": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Im5hdHRhcG9uLnJAbGl2ZS5jb20iLCJpZCI6IjViMzA2ZGJkYmRmZGQ4NGYxZmFlOGI0MCIsImV4cCI6MTUzMDE1ODY0NiwiaWF0IjoxNTMwMDcyMjQ2LCJpc3MiOiJuYXR0YXBvbi5yQGxpdmUuY29tIn0.XghHHAg5qKRLqYuQ7g7Y7qolT4YeAlbwJrQcGDp1AHQ",
"isSuccess": true
}
POST /api/v1/auth/verifyAccount
Field | Description | Optional |
---|---|---|
secret | secret hash string | No |
{
"data": {
"id": "5b51ae5e083713dbe7d4f6f0",
"name": "",
"firstname": "",
"lastname": "",
"email": "rattajak.n3@gmail.com",
"gender": "",
"birthdate": "",
"tel": "",
"authenTypeId": -1,
"authenId": "",
"authenToken": "",
"verified": true,
"verifiedAt": "2018-07-20T10:26:50.003Z",
"roles": [
"user"
],
"createAt": "2018-07-20T09:41:50.66Z",
"lastModified": "2018-07-20T10:24:11.53Z"
},
"isSuccess": true
}
POST /api/v1/auth/resendEmail
Field | Description | Optional |
---|---|---|
- | No |
{
"data": {
"message": "Verification email will send to you as rattajak.n2@gmail.com",
"secret": "mF4TgVedPAeVUBDApw9o8CgtY2M15nUxOR52Z89w1II-MBRMyA==",
"success": true
},
"isSuccess": true
}