Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8285541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:29:39+00:00 2026-06-08T11:29:39+00:00

I am attempting to make an API OAUTH2 call to Shopify to authenticate. When

  • 0

I am attempting to make an API OAUTH2 call to Shopify to authenticate. When I go to my application, the first screen comes up. I press Install, and then it redirects me back to where I started. The problem is that when I get redirected, I cannnot seem to catch it in my jQuery ajax function and therefore I am unable to get the temporary token I need to create my permanent token from OAUTH. The 2nd image shows what is happening after I press install. My code so far is posed below. None of the console.log() functions are being called after I run the ajax call.

My application URL for my app is set to

http://localhost 

and my application is running from

http://localhost/shippingcalculator.

I tested the calls in an external REST client program, and I managed to successfully get my access token, so it is not a problem with my credentials.

200OK and then the 302 Redirect

Runs fine in a REST client tester

<!DOCTYPE html>

 <script type="text/javascript">
function getParameterByName(name) {
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regexS = "[\\?&]" + name + "=([^&#]*)";
    var regex = new RegExp(regexS);
    console.log(window.location.search);
    var results = regex.exec(window.location.search);
    if (results == null) return "";
    else return decodeURIComponent(results[1].replace(/\+/g, " "));
}

function getTemporaryToken(token) {
    jso_configure({
        "shopify": {
            client_id: "67d7af798dd0a42e731af51ffa", //This is your API Key for your App
            //redirect_uri: "", OPTIONAL - The URL that the merchant will be sent to once authentication is complete. Must be the same host as the Return URL specified in the application settings
            authorization: "https://emard-ratke3131.myshopify.com/admin/oauth/authorize",
            //In your case the authorization would be https://SHOP_NAME.myshopify.com/admin/oauth/authorize
            scope: ["read_products"], //Set the scope to whatever you want to access from the API. Full list here: http://api.shopify.com/authentication.html
        }
    });
    $.oajax({
        url: "https://emard-ratke3131.myshopify.com/admin/oauth/authorize",
        jso_provider: "shopify",
        jso_scopes: ["read_products"],
        jso_allowia: true,
        success: function(data) {
            //Use data and exchange temporary token for permanent one
            if (jqXHR.status === 200) {
                console.log("200");
            }
            if (jqXHR.status === 302) {
                console.log("300");
            }
            console.log("Response (shopify):");
            console.log(data);
        },
        error: function(e) {
            console.log("Fail GET Request");
            console.log(e);
        },
        complete: function(xmlHttp) {
            // xmlHttp is a XMLHttpRquest object
            console.log(xmlHttp.status);
        }
    });
    console.log("Code: " + getParameterByName("code"));
}
}
$(document).ready(function() {
    getTemporaryToken();
});
</script>
</head>
<body>
Hello World!
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T11:29:40+00:00Added an answer on June 8, 2026 at 11:29 am

    It’s a pretty bad idea to do all of this client side, your API key will be in the clear for anyone to see and use. On top of that where will you store the token? There are also cross site scripting restrictions built into all browsers that will prevent JavaScript from making calls to sites other than the one the js is loaded from.

    You should really do the authentication and make all your API calls from a server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to make my first mobile website by just using a different
I'm attempting to do a Facebook FQL Multiquery (via JS SDK FB.api call) to
I'm attempting to make an API type app in Symfony 1.4. My goal is
I am attempting to make a full scale game for the first time and
I am attempting to use the tweepy api to make a twitter function and
I am attempting to make the following call, PID = pthread_create(&t, NULL, schedule_sync(sch,t1), NULL);
Attempting to make a NSObject called 'Person' that will hold the login details for
I'm attempting to make a python package of the following hierarchy: \standard \__init__.py \text.txt
I'm attempting to make a simple linear text game that will display inside a
I was attempting to make some expression templates as an answer to this question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.