Development discussions around Shopify APIs
I have request an access token and saved it in my database so all my apps can use it. It works on that day but on the next day my app start getting 401 error saying my token is not valid. It works again after I make a OAuth request and update the token on my database.
In the documentation it seems access token is permanent, but none of it explicitly state that. Is access token permanent or will it expired? If it expired, what is the duration of the token?
Solved! Go to the solution
This is an accepted solution.
Hi @alcfy,
Offline access tokens don't expire unless your app is uninstalled or you revoke the access token. Online access tokens on the other hand, only last as long as the user's admin session. You can read about the different access modes here.
Can you check which mode you are using?
Andrew | Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
This is an accepted solution.
Hi @alcfy,
Offline access tokens don't expire unless your app is uninstalled or you revoke the access token. Online access tokens on the other hand, only last as long as the user's admin session. You can read about the different access modes here.
Can you check which mode you are using?
Andrew | Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
It does seems my token is online access token, thanks for the info. Would appreciate if it is mentioned in the OAuth doc
Hi,
How can I revoke access token?
Thanks,
Sourav
How do we request for offline access token?
nm, found a relevant thread
If anyone stumbles upon this:
If you are using KOA, then 'online' mode is DEFAULT! This is completely misleading...
https://www.npmjs.com/package/@shopify/koa-shopify-auth
ATTENTION: verifyRequest and shopifyAuth BOTH need to specify 'offline' as default. See the documentation!
User | RANK |
---|---|
51 | |
11 | |
6 | |
6 | |
6 |
Thanks to all who participated in our AMA with 2H Media on planning your 2023 marketing bu...
By Jacqui Mar 30, 2023Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023