Cannot complete OAuth process. No session found for the specified shop url

Topic summary

A developer encountered an OAuth error while building a Shopify app using Node.js and Express: “Cannot complete OAuth process. No session found for the specified shop url.” The error occurred during Shopify.Auth.validateAuthCallback().

Key Issues Identified:

  • Missing or improperly configured SESSION_STORAGE in the Shopify context initialization
  • Use of unstable API version
  • Potential redirect URL formatting problems

Resolution:

  • The original poster resolved the issue by switching from the unstable API version to the most recent stable version and updating the library

Follow-up:

  • Another user requested specific details about which API version was changed and example code showing the fix
  • A community member suggested examining the session storage load/store functions and explicitly setting SESSION_STORAGE in the configuration
Summarized with AI on November 19. AI used: claude-sonnet-4-5-20250929.

Currently I’m building out an express app using the Shopify tutorial for node.js and express.js, but I run into an error that states: Error: Cannot complete OAuth process. No session found for the specified shop url: store_url.com . The error occurs at: await Shopify.Auth.validateAuthCallback().

var router = require("express").Router();
module.exports = router;
var Shopify = require("@shopify/shopify-api").Shopify;
var ApiVersion = require("@shopify/shopify-api").ApiVersion;

Shopify.Context.initialize({
  API_KEY: process.env.SHOPIFY_API_KEY,
  API_SECRET_KEY: process.env.SHOPIFY_API_SECRET,
  SCOPES: process.env.SHOPIFY_API_SCOPES,
  HOST_NAME: global.env.ROOT_URL.replace(/https:\/\//, "") + "/api/shopify",
  API_VERSION: ApiVersion.Unstable,
  IS_EMBEDDED_APP: false,
});

var shops = [];
router.get("/", async function (req, res, next) {
  if(typeof shops[req.query.shop] !== 'undefined') {
    console.log("Already Logged Signed Up");
  }else{
    res.redirect("/api/shopify/auth?shop="+req.query.shop);
  }
});

router.get("/auth", async function (req, res, next) {
  const authRoute = await Shopify.Auth.beginAuth(req, res, req.query.shop, '/auth/callback', false);
  res.redirect(authRoute);
});

router.get("/auth/callback", async function (req, res, next) {
  const shopSession = await Shopify.Auth.validateAuthCallback(req, res, req.query);
  shops[req.query.shop] = shopSession;
  res.redirect("");
});

Can you share your session SESSION_STORAGE (especially the load and store functions)? It is most likely the source of error.

This error is raised because in the app is not able to load the session stored see this code where this error is raised here.

Some nit remarks about your code

  1. In your initialization it does not seem that you set SESSION_STORAGE explicitly, I would recommend setting that explicitly.
  2. Your host name has a suffix that you again call in the redirect here, not sure if this is causing any issue res.redirect("/api/shopify/auth?shop="+req.query.shop);
  3. What is the motivation of using unstable API?

I did find the solution. I changed versions of the API from unstable to most recent stable and updated my library. That seems to have fixed it.

Thank You

1 Like

Hi Mikhail, what api did you change and to what version?

Could you show the code example please?

Thank you!