I have been writing services in OSB 12C for REST and SOAP, so am familiar with development. I have a new requirement where I am facing trouble on how to get started.
The 3rd party provider has exposed two services that will be called as business endpoints. The main one is for sending transactional data in REST and is pretty straightforward in itself. The problem point is that it requires a bearer token in the authorization header.
To get the token, a second API has been provided with a fixed key as a parameter. When it is called, it returns a bearer token that expires in 72 hours.
So, the requirement is thus: When the backend app calls my OSB proxy service, the value of the bearer token would be fetched (from where? Can OSB persist data?). If the token has expired – or nearing expiration – OSB should call the second API to fetch a fresh token and store it for use in the next 72 hours. Once a valid token is available, OSB should make the call to the first API.
I am not seeking step-by-step instructions; instead, an indication of which way to go would be helpful.