Log in to Skyline CRS using the booking credentials to access protected endpoints.
The client sends an authentication request to the /login
endpoint with the required credentials: PNR ID, first name and last name of the person who made the booking.
The login service will verify the credentials with the existing data.
{
"sub": "<The PNR ID of this access token>",
"iat": "<The unix time this token has been issued>",
"exp": "<The unix time for this token to expire (30 minutes since issued)>",
}
Example payload (decoded):
{
"sub": "f362846f-679d-4ef7-857d-e321c622cb41",
"iat": "1639176300",
"exp": "1639178100"
}
Using the secret secret
, the following JWT token would be generated:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJmMzYyODQ2Zi02NzlkLTRlZjctODU3ZC1lMzIxYzYyMmNiNDEiLCJpYXQiOiIxNjM5MTc2MzAwIiwiZXhwIjoiMTYzOTE3ODEwMCJ9.l1smQvKIIWZG6dLLopUrXsWs7cff8_SJQ0JYwB_sd9g
Authorization
header for authorization. Using an invalid or expired token would result in an error response of course, and would require the client to re-authenticate (starting from step 1 as seen above).POST /login
{
"pnrId": "<The PNR ID (booking number) of the requested booking>",
"firstName": "<First name of the person who made the booking>",
"surname": "<surname of the person who made the booking>"
}
Example:
{
"pnrId": "f362846f-679d-4ef7-857d-e321c622cb41",
"firstName": "John",
"surname": "Doe"
}
200 OK
{
"token": "<The JWT access token>"
}
Example:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJmMzYyODQ2Zi02NzlkLTRlZjctODU3ZC1lMzIxYzYyMmNiNDEiLCJpYXQiOiIxNjM5MTc2MzAwIiwiZXhwIjoiMTYzOTE3ODEwMCJ9.l1smQvKIIWZG6dLLopUrXsWs7cff8_SJQ0JYwB_sd9g"
}
400 Bad Request
{
"error": "Log in failed",
"message": "Could not authenticate booking for the given PNR ID with the given first name and surname."
}
422 Unprocessable Entity
{
"error": "Validation error",
"message": "Request has an invalid format.",
"details": [
{
"cause": "<Path to the missing credential>",
"message": "<Specific error message>"
},
]
}
Example:
{
"error": "Validation error",
"message": "Request has an invalid format.",
"details": [
{
"cause": "body/surname",
"message": "field is required"
},
]
}