I am testing a custom plugin that makes a request to an external service. That request needs the currentUser's access_token. The external service will validate that the user is logged in by making a call to the BF public API. The user in the dev environment does not exist in the API database, so I can't test the complete flow.
How can I make my dev app authenticate with the "real" database, and not the "fake" one stored on localhost?
CodePudding user response:
Access token should be a real one if you use "App Login" on top of the widget frame and if you have the correct app ID used.
Your problem is more likely that by default the app ID is a fake app ID and public APIs do not work with fake IDs.
You can change the app ID and datastore write key in plugin tester settings screen as below:
Getting the real app ID is easy. you can find it in Share Setting on the control panel (app.buildfire.com):
Getting the datastore write key can only be achieved from console by executing buildfire.getContext().datastoreWriteKey
while targeting the control iframe as shown below:
If you don't set the correct datastore write key datastore insert / update statements will fail.