Learn · 2:25 video

How OHIP OAuth works

The credentials you need, how to get a token from the OHIP gateway, and what goes on every call to OPERA Cloud.

Transcript

Why OAuth

Every call to Oracle OPERA Cloud through OHIP, Oracle's integration platform, has to prove which application is calling, and that it is allowed in. OHIP does this with OAuth. Here is how it works.

Three credentials

You start with three credentials. An application key, which you get when you register your application in the OHIP Developer Portal. And a client ID and client secret for your OPERA Cloud environment: one environment is one chain, with one client ID.

Ask for a token

With those, you ask the gateway for a token. You send a POST to its OAuth tokens endpoint, with the client ID and secret as HTTP Basic authentication, and the application key in the x-app-key header.

Two ways in

What else goes in depends on how your environment signs in. With the password grant, you also send the username and password of an integration user that the hotel approves for you. With client credentials, there is no integration user: you send a fixed scope and your enterprise ID instead.

Moving to client credentials

Oracle is moving environments to client credentials, one at a time. The environment's card in the Developer Portal shows which one yours uses.

The token

Back comes an access token: a JSON web token with its expiry time inside. Oracle's advice is to request a new one two minutes before it expires.

Every call

Every API call then carries the token as a Bearer token in the Authorization header, the application key again, and for property APIs, the hotel ID in the x-hotelid header, even when the hotel is already in the address.

Two habits

Two habits help. Reuse the token until it is close to expiry, instead of asking for one per call: for integration partners, token requests are billable. And if you reissue the client ID, a new secret comes with it and the old pair stops working, so update every system that uses it.

In short

So: an application key, a client ID and secret, plus an integration user, or a scope and enterprise ID. Trade them for a token, send it with every call, and renew it before it expires. That is OHIP OAuth.

StayFn

If you would rather not build this yourself, StayFn runs your OHIP integrations with authentication and tokens already handled.

Oracle's documentation

Everything in the video comes from Oracle's public OHIP documentation. Your environment's card in the OHIP Developer Portal shows which sign-in method it uses.

How StayFn calls OHIP: Connect to OHIP in the docs, and the OHIP layer on the product page.

See StayFn run against OPERA Cloud

A 30-minute walkthrough: we connect to the OHIP sandbox, write a function together and watch it run in the dashboard.