OAuth redirection is not working on ios safari.

New Member
1 0 0

Hi everyone. I am creating mobile app to use shopify api.

For using shopify api, use shopify oauth first. it works well. After login with my account, redirect from safari from to app and can get authorization code and so can get access code and can use this access code to use shopify apis.


I used above url and can get like as following url with authorization code:



But when token is expired, and so need to receive authorization code, and so oauth again. Then my app open safari but there is a saved cookie in safari and so there is no login form and generate authorization code. but doesn't redirect to the app. So app can't get authorization code.

Thanks in your advance.



Shopify Staff (Retired)
Shopify Staff (Retired)
624 102 127

Hi @waterflower1259 ,


During the initial OAuth flow when the merchant is installing your app and you are redirecting the user to the following URL https://{shop}.myshopify.com/admin/oauth/authorize, if you set the field of `grant_options[]` as blank instead of per-user then your access mode will be set to Offline instead of Online.


With Offline access mode your access token will only expire if the merchant uninstalls your app. This way you do not have to worry about the token expiring after the session ends and starting the OAuth session over again and again. 


I would also recommend looking into the libraries like the koa-shopify-auth Node.js package and shopify_app ruby gem to help handle the OAuth process for your app: https://www.npmjs.com/package/@shopify/koa-shopify-auth and https://github.com/shopify/shopify_app


Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution