Your server acts as identity provider. SIHOT.PMS sends its credentials (client id and client secret) to your endpoint S_AUTHENTICATE, and your server returns an access token in the standard JWT format. SIHOT.PMS checks the JWT and sends it with the following voucher requests. You issue the token and validate it on every request.
S_AUTHENTICATE is an endpoint on your server. It is not the SIHOT@360° service S_AUTHENTICATE, which returns a SecurityID, and not the SIHOT@360° service S_AUTHENTICATE_JWT. Your endpoint uses the OAuth 2.0 client credentials format described on this page and returns a JWT, not a SecurityID.
You provide the following values to the hotel. The hotel enters them in the SIHOT.PMS configuration of the gift voucher interface:
| Value | Description |
|---|---|
| Base URL | URL of your server. See Implementation Basics. |
| Client id | User name of SIHOT.PMS at your server (setting "Client ID"). SIHOT.PMS sends it as client_id. |
| Client secret | Password of SIHOT.PMS at your server (setting "Client secret"). SIHOT.PMS sends it as client_secret. |
The hotel provides you with its property UUID. You need it for the claim hotelUuid of the token.
Request – POST <base URL>/S_AUTHENTICATE
POST /sihot/S_AUTHENTICATE HTTP/1.1
Host: giftvoucher.example.com
Content-Type: application/x-www-form-urlencoded
X-SIHOT-Env: PROD
client_id=pms-hotel-4711&client_secret=********&grant_type=client_credentials&scope=voucher.read%20voucher.write
grant_type is always client_credentials and scope is always voucher.read voucher.write.
Response
Answer with HTTP status 200 and the token in access_token:
SIHOT.PMS evaluates only access_token.
If the credentials are wrong, answer with an error status, for example 400. SIHOT.PMS then shows the user that the authentication with the partner system failed.
The access token must be a JWT that meets the following requirements:
| Part | Requirement |
|---|---|
Header typ |
Must be JWT. |
Claim exp |
Required. Expiry time as number (Unix time in seconds). SIHOT.PMS rejects a token that has already expired when it receives it. |
Claim hotelUuid |
Required. Property UUID of the hotel. It must be identical to the value that the hotel has provided, including upper and lower case. |
Claim env |
Optional, strongly recommended. Environment of the calling SIHOT.PMS installation: take the value from the header X-SIHOT-Env of the token request, for example PROD. |
Before you issue a token, check that the header X-SIHOT-Env of the token request matches the environment of your system. If it does not match, do not issue a token. See Environment Check.
env will become mandatory in a later version of the interface. Include it in your tokens already now.
Sample Token Payload
SIHOT.PMS sends the token in the header Authorization of the voucher requests:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
SIHOT.PMS requests a new token for each redemption and normally uses the same token for S_EXTERNAL_GIFTVOUCHER_GET and S_EXTERNAL_GIFTVOUCHER_REDEEM. Because the user confirms the redemption between the two requests, issue tokens that stay valid for several minutes, for example one hour.
Validate the token on every request: signature, expiry, hotelUuid and, if present, env. Restrict the access so that a token can only be used for the vouchers of its hotel and environment.