Giter VIP home page Giter VIP logo

Comments (4)

sharad225 avatar sharad225 commented on July 22, 2024

Dear Team,

I am trying to install our public app on a Shopify store and the code returned including the redirect URL is used for generating the access token.
But our repeated call to generate access token is always resulting in the following error:
"oauth error invalid request the authorization code was not found or already used"

We did this twice with the Shopify store owner, installing, uninstalling and reinstalling, but kept getting the same error.
How do we get this error resolved and be able to generate the Shopify access token?
Please help.

Regards,
Sharad

from shopifysharp.

nozzlegear avatar nozzlegear commented on July 22, 2024

Hi @sharad225, this error means that the code value in the querystring that you get when a user is redirected back to your site has already been used when you're trying to create an access token. In many cases it's because a user accidentally refreshed the page or the page was reloaded in some way that made the operation repeat. I'd also try to step through all of your code that gets run after the user gets redirected back to your site to make sure it's not accidentally being run more than once.

from shopifysharp.

sharad225 avatar sharad225 commented on July 22, 2024

Hi Nozzlegear, Thank you for your response and for looking into this.
Let me explain:
As soon as the Shopify show onwer clicks to accept the installation of our app, he gets redirected to the following URL:

http://mywebsite.com/?code=d119551fb7cdd820012c6b2cb7b12495&hmac=10976937c09a1f1e3db6275d12cae8fbd43415a6d5b031ec14a70128b8fe9dfe&shop=<shopifysite>.myshopify.com&state=11122777&timestamp=1478065253

mywebiste.com is our website which integrates with the Shopify Shop accessing various APIs through the access token and <shopifysite>.myshopify.com is the actual Shopify Shop.

This redirected URL is being provided to us by the Shopify Shop owner in an email.

This URL contains the code parameter. We take this code parameter and hit another Shopify API for generating the access token - using the following URL:
https://<shopifysite>.myshopify.com/admin/oauth/access_token and pass the following 3 POST parameters : client_id, client_secret and code

We haven't yet written the code for the creation of access token, instead we do this process of generating the access token through POSTMAN, which is a manual process. We are planning to write the script which will automatically parse the redirected URL and generate the access token, but as of now we are doing this manually.

Let me know any other details you will require and I will provide it.
Regards,
Sharad

from shopifysharp.

sharad225 avatar sharad225 commented on July 22, 2024

Hi Nozzlegear,

Any feedback sir?
We really need some help here. I would really appreciate it.

Regards,
Sharad

from shopifysharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.