0
First and foremost, my setup:
- Ubuntu Server 18.04
- Loopback API 3.X
- Node version 12.6
My issue:
I set up Loopback API and created a few models and users. Now, all I need LoopbackAPI for is really to POST customer-created Plans via Chargebee WebHook.
Here is a short explanation on how it is supposed to work:
- Customer creates a plan
- Chargebee WebHook authenticates via AccessToken at LoopbackAPI (e.g. http://api-url/example?request_token=12345678
- The details of the created plan are then sent via POST to LoopbackAPI
This works as long as the server is running and I manually login (curl) with the user and create the AccessToken. If that created token is used the whole chain works fine. However, as soon as I restart the server I am unable to login because the AccessToken is not valid anymore (401 on chargebee).
The AccessToken-Datasource is set to be stored in mysql and I think this is the issue here. The table is there and when I manually login I see one row with the created user+token but as soon as the server restarts its gone (empty table)
I am mainly Ops and not really a Developer, therefore please let me know if I making a big mistake here or if I forgot to provide needed info. My main question is how to get this one AccessToken to persist after reboot but if someone got any security recommendations I would love to hear them as well.
Cheers