I am working on a new provider integration. The integration are secured with an Access token. The flow is as following:
1. Get an Access Token/Refresh token from Token provider from http://url1/token
2. Call a CRUD rest api on a different url with the token received from the token provider. E.g POST http://url2/user/role
I was thinking about using ScriptedCRESTConnector with Groovy for the action-scripts, but how to inject 2 different urls into the CRUD-scripts.
Is it an other and better way to do this? We are currently using OpenIDM 4.5, but an update to IDM6.0 are planned in not so distance future.
The only logical way I am thinking of is to create an interceptor that will
a) Get an Access Token from cache
b) Add Access Token to request
c) if that request fails, get a new Access Token for the cache
d) replay request with that Access Token.
Just working it all out, as I have working example for OKHTTP3, but not Apache HTTPClient.