Issue related to BigCommerce’s REST API Authentication
See original GitHub issueHello! 😊
So I already ran vercel link
and vercel env pull .env.local
, updating the local env variables from VERCEL
until BIGCOMMERCE_CHANNEL_ID
(For the Bigcommerce env variables already automatically updated from Vercel CLI). But unfortunately, it requires authentication every time I ran yarn dev
. Here’s the error below:
Error: Authentication required
at FetcherError.CommerceError [as constructor] (/Applications/projects/topdurian/node_modules/@bigcommerce/storefront-data-hooks/commerce/utils/errors.js:35:24)
at new FetcherError (/Applications/projects/topdurian/node_modules/@bigcommerce/storefront-data-hooks/commerce/utils/errors.js:47:28)
at /Applications/projects/topdurian/node_modules/@bigcommerce/storefront-data-hooks/api/utils/fetch-graphql-api.js:75:31
at step (/Applications/projects/topdurian/node_modules/@bigcommerce/storefront-data-hooks/api/utils/fetch-graphql-api.js:44:23)
at Object.next (/Applications/projects/topdurian/node_modules/@bigcommerce/storefront-data-hooks/api/utils/fetch-graphql-api.js:25:53)
at fulfilled (/Applications/projects/topdurian/node_modules/@bigcommerce/storefront-data-hooks/api/utils/fetch-graphql-api.js:16:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5) {
errors: [ { message: 'Authentication required' } ],
status: 401
}
For the API token, I’ve created some API accounts to test but due to the default API path https://api.bigcommerce.com/stores/4umfspsrro/v3/[url]
after deployed via Vercel, it returns The route is not found, check the URL
. The issue may be the same as #26 despite the difference was an error appears every time I ran localhost after loaded the .env.local
file so I couldn’t access the page locally.
Thank you! 😊
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:21 (3 by maintainers)
Top Results From Across the Web
Authentication
Authentication. BigCommerce offers a suite of APIs that let you manage store data, sign customers in, make client-side queries for product information, ...
Read more >Is there any change in bigcommerce rest api authentication?
Is there any change in bigcommerce rest api authentication? I can not seem to access the users store products and its images. Everything...
Read more >Guide to API Accounts
BigCommerce offers two types of OAuth-based API accounts to developers who wish to use BigCommerce's REST APIs: store management credentials and app credentials ......
Read more >API Status Codes
BigCommerce REST APIs and GraphQL APIs respond to each request with an HTTP status code that depends on the result from the request....
Read more >How to resolve 403 authentication status returned from API?
I believe you will need to make sure you set the proper scopes when you created your V2/V3 API token. In this case,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @RayeEThompson, I’m having issues with the Vercel generated token, the API fails with “an error occurred” message, I checked the source and saw that the error is coming from the login which is made after the signup, seems like is not a BigCommerce dependency internal error.
I tried with different generated tokens, twice, both fails
Is there any way to provide you a minimal reproduction? since it contains tokens I can’t publish the code on github I guess
Site is live and error is happening on prod version too => https://fl-store-f6a0s0ni1.vercel.app/
Customers are being created on BigCommerce, but login fails
EDIT: I just tried this:
{ "data": null, "errors": [ { "message": "Internal server error", "path": [ "login" ], "locations": [ { "line": 2, "column": 3 } ] } ] }
Which makes me think that the problem is not coming from Vercel generated tokens but BigCommerce GraphQL API, for both steps I used the Vercel generated tokens, and they work fine
Thanks!
I created a fresh clone, and I am still gettin the same issues