Authentication
Authentication APIs reference
Summary
Authentication method to access SkyJoy APIs
Methods
Retrieve Access Token
POST
https://id.skyjoy.vn/realms/loyalty-partner/protocol/openid-connect/token
Request Body
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJtQ3hjTHdLTkFVVVFXSkI5MlBnUHpDanNsalN2NEU1U3hIT2lvdWJYUGpzIn0.eyJleHAiOjE2OTQ0Mzg5MDksImlhdCI6MTY5NDQwMjkwOSwianRpIjoiNWNmZTY3NWEtNWQzMC00MGUzLTljYmEtZWNlNTFkN2Q4OTcxIiwiaXNzIjoiaHR0cHM6Ly9pZC5kZXYuc2t5am95LmlvL3JlYWxtcy9sb3lhbHR5LXBhcnRuZXIiLCJhdWQiOiJhY2NvdW50Iiwic3ViIjoiZDA3NDRhZDItY2YxYy00MWYzLThjNDMtZjkzZjFhZmQzY2I2IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiMTMyNjhlYzEtMTJkMS00MjIzLWIxNjMtYjg0M2M5MjU4ZmVmIiwic2Vzc2lvbl9zdGF0ZSI6ImEwMWMyMGI1LTBmN2QtNDk3MC04ZWE3LTJmNDk1YzcyOGY2ZSIsImFjciI6IjEiLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsib2ZmbGluZV9hY2Nlc3MiLCJ1bWFfYXV0aG9yaXphdGlvbiIsImRlZmF1bHQtcm9sZXMtbG95YWx0eS1wYXJ0bmVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJlbWFpbCBwcm9maWxlIiwic2lkIjoiYTAxYzIwYjUtMGY3ZC00OTcwLThlYTctMmY0OTVjNzI4ZjZlIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJuYW1lIjoiVmlldGpldCBBaXIiLCJ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iJlbWFpbCBwcm9maWxlIiwic2lkIjoiYTAxYzIwYjUtMGY3ZC00OTcwLThlYTctMmY0OTVjNzI4ZjZlIn0.HeCI5e0uGC1bSCzC0dDTY6gUG9abUkCbcDGZWyhUsms",
"token_type": "Bearer",
"session_state": "a01c20b5-0f7d-4970-8ea7-2f495c728f6e",
"scope": "email profile"
}
curl -X POST \
--header 'Content-Type: x-www-form-urlencoded' \
--data-urlencode 'client_id=<your client id>' \
--data-urlencode 'client_secret=<your client secret>' \
--data-urlencode 'username=<your client username>' \
--data-urlencode 'password=<your client password>' \
--data-urlencode 'grant_type=<your grant type>' \
'https://id.skyjoy.vn/realms/loyalty-partner/protocol/openid-connect/token'
Refresh Token
POST
https://id.skyjoy.vn/realms/loyalty-partner/protocol/openid-connect/token
Request Body
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJtQ3hjTHdLTkFVVVFXSkI5MlBnUHpDanNsalN2NEU1U3hIT2lvdWJYUGpzIn0.eyJleHAiOjE2OTQ0Mzg5MDksImlhdCI6MTY5NDQwMjkwOSwianRpIjoiNWNmZTY3NWEtNWQzMC00MGUzLTljYmEtZWNlNTFkN2Q4OTcxIiwiaXNzIjoiaHR0cHM6Ly9pZC5kZXYuc2t5am95LmlvL3JlYWxtcy9sb3lhbHR5LXBhcnRuZXIiLCJhdWQiOiJhY2NvdW50Iiwic3ViIjoiZDA3NDRhZDItY2YxYy00MWYzLThjNDMtZjkzZjFhZmQzY2I2IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiMTMyNjhlYzEtMTJkMS00MjIzLWIxNjMtYjg0M2M5MjU4ZmVmIiwic2Vzc2lvbl9zdGF0ZSI6ImEwMWMyMGI1LTBmN2QtNDk3MC04ZWE3LTJmNDk1YzcyOGY2ZSIsImFjciI6IjEiLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsib2ZmbGluZV9hY2Nlc3MiLCJ1bWFfYXV0aG9yaXphdGlvbi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L3JlYWxtcy9sb3lhbHR5LXBhcnRuZXIiLCJhdWQiOiJodHRwczovL2lkLmRldi5za3lqb3kuaW8vcmVhbG1zL2xveWFsdHktcGFydG5lciIsInN1YiI6ImQwNzQ0YWQyLWNmMWMtNDFmMy04YzQzLWY5M2YxYWZkM2NiNiIsInR5cCI6IlJlZnJlc2giLCJhenAiOiIxMzI2OGVjMS0xMmQxLTQyMjMtYjE2My1iODQzYzkyNThmZWYiLCJzZXNzaW9uX3N0YXRlIjoiYTAxYzIwYjUtMGY3ZC00OTcwLThlYTctMmY0OTVjNzI4ZjZlIiwic2NvcGUiOiJlbWFpbCBwcm9maWxlIiwic2lkIjoiYTAxYzIwYjUtMGY3ZC00OTcwLThlYTctMmY0OTVjNzI4ZjZlIn0.HeCI5e0uGC1bSCzC0dDTY6gUG9abUkCbcDGZWyhUsms",
"token_type": "Bearer",
"session_state": "a01c20b5-0f7d-4970-8ea7-2f495c728f6e",
"scope": "email profile"
}
curl -X POST \
--header 'Content-Type: x-www-form-urlencoded' \
--data-urlencode 'client_id=<your client id>' \
--data-urlencode 'client_secret=<your client secret>' \
--data-urlencode 'grant_type=<your grant type>' \
--data-urlencode 'refresh_token=<your refresh token>' \
'https://id.skyjoy.vn/realms/loyalty-partner/protocol/openid-connect/token '
Exchange Token
POST
https://api.skyjoy.vn/api-identity/public/v1/exchange-token
Request Body
Partner token. It is a JWT token signed by partner private key
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...",
"refresh_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...",
"expires_in": 1712498546,
"refresh_expires_in": 1712598546,
"token_type": "Bearer "
}
curl -X POST \
--header 'Content-Type: application/json' \
-d '{"token":"eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi..."}' \
'https://api.skyjoy.vn/api-identity/public/v1/exchange-token'
Last updated