skip to Main Content

I am using laravel to build an app in BigCommerce. I am able to get access token but I need to store that for future requests. What is the best possible way to store the app data for BigCommerce?

2

Answers


  1. Chosen as BEST ANSWER

    I've got this working by creating a DB schema in Laravel where in there are tables like stores, users, app_settings.

    Whenever the user installs an app, I am storing an access token and other information like store hash in stores table and user details in users table.

    Whenever the app is loaded I could get the store and user information via verify signed request payload. Using this I am able to configure my app settings for the user and store those in app settings table.

    So when I create a Webhook for the store, I could get the store hash from response as producer key and accordingly I can find the access token for the store using store hash in stores table.


  2. If you’re git ignoring your config.json or .env files, you could store these there. However after speaking with one of our Developer Advocates, I wanted to pass along some best practice advice. 🙂 You may want to consider using a secrets manager for option #1 in your decision here. A secrets manager meaning a tool to safely store these variables like Secrets in Github or Key Vault in Azure.

    Also, this resource may be helpful to review for your use case. https://www.codementor.io/@ccornutt/keeping-credentials-secure-in-php-kvcbrk55z

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search