The two videos on connecting API data were very helpful, but did not go into authentication concerns.
In my example, I want to store the API base URL and authentication credentials in Builder. Is the best way to do this with a data model?
Authentication needs to run to get a token, which is to be passed with each request, in the http header. What is the best place to locate the call to get an auth header? Also, the token expires after 15 mins non usage, so, there needs to be a mechanism to refresh or retrieve a new token.
I want for all of this to happen in the server side, to protect the auth credentials as well as the token.
After much time spent researching and trying various things, answering my own question:
There are numerous complications with with trying to connect to an authenticated API with Builder, directly. In addition, if there are going to be interactions directly from the browser, you’ll need the middleware anyway. We threw together some code that runs under web app server. Running the middleware under the same name as the website has certain advantages as well.