Will access token expired?

Solved
alcfy
Shopify Partner
5 0 1

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?

Accepted Solution (1)

Accepted Solutions
Busfox
Shopify Staff
619 49 99

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

View solution in original post

Replies 4 (4)
Busfox
Shopify Staff
619 49 99

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

View solution in original post

alcfy
Shopify Partner
5 0 1

It does seems my token is online access token, thanks for the info. Would appreciate if it is mentioned in the OAuth doc

souravchandra
Tourist
19 0 1

Hi,

 

How can I revoke access token?

 

Thanks,

Sourav

dgtlmonk
Excursionist
18 1 3

How do we request for offline access token?

 

nm, found a relevant thread