Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

403 Forbidden SSL required from standard config in express library docs #711

Open
eatoncw opened this issue Mar 23, 2024 · 4 comments
Open
Labels

Comments

@eatoncw
Copy link

eatoncw commented Mar 23, 2024

Issue summary

Before opening this issue, I have:

  • [ x] Upgraded to the latest version of the package
    • @shopify/shopify-app-* package and version:
    • Node version:
    • Operating system:
  • [ x] Set { logger: { level: LogSeverity.Debug } } in my configuration, when applicable
  • [ x] Found a reliable way to reproduce the problem that indicates it's a problem with the package
  • [ x] Looked for similar issues in this repository
  • [ x] Checked that this isn't an issue with a Shopify API

@shopify/shopify-app-express Documentation contains a configuration that causes a REST resources error of 403 Forbidden SSL required.

I spent some time debugging this after I updated shopify-app-js and packages across my app.

The page in question: https://github.com/Shopify/shopify-app-js/blob/main/packages/shopify-app-express/docs/reference/shopifyApp.md

The config in question:

const shopify = shopifyApp({
  api: {
    apiKey: 'ApiKeyFromPartnersDashboard',
    apiSecretKey: 'ApiSecretKeyFromPartnersDashboard',
    scopes: ['your_scopes'],
    hostScheme: 'http',
    hostName: `localhost:${PORT}`,
    billing: {
      'My plan': {
        amount: 10,
        currencyCode: 'USD',
        interval: BillingInterval.Every30Days,
      },
    },
  },
  auth: {
    path: '/auth',
    callbackPath: '/auth/callback',
  },
  webhooks: {
    path: '/webhooks',
  },
});

// The paths to these routes must match the configured values above
app.get(shopify.config.auth.path, shopify.auth.begin());
app.get(
  shopify.config.auth.callbackPath,
  shopify.auth.callback(),
  shopify.redirectToShopifyOrAppRoot(),
);
app.post(
  shopify.config.webhooks.path,
  shopify.processWebhooks({webhookHandlers}),
);

Changing the host scheme to 'https' fixed this problem. Maybe put something in the docs about this or update the sample config on this page.

Expected behavior

What do you think should happen?

Actual behavior

What actually happens?

Steps to reproduce the problem

Debug logs

// Paste any relevant logs here
@lizkenyon
Copy link
Contributor

Thanks for flagging!
We will get those docs updated!

Copy link
Contributor

We're labeling this issue as stale because there hasn't been any activity on it for 60 days. While the issue will stay open and we hope to resolve it, this helps us prioritize community requests.

You can add a comment to remove the label if it's still relevant, and we can re-evaluate it.

@github-actions github-actions bot added the Stale label May 25, 2024
@andershagbard
Copy link

@lizkenyon This still seems to happen. Why would the API ever send requests the http version of the API?

For context, I use an external service, which boots up in the same repo, and runs some code. It doesn't necessarily get the same .env variables. If "appUrl" is set to a http path, it will fail.

@github-actions github-actions bot removed the Stale label Jul 16, 2024
Copy link
Contributor

We're labeling this issue as stale because there hasn't been any activity on it for 60 days. While the issue will stay open and we hope to resolve it, this helps us prioritize community requests.

You can add a comment to remove the label if it's still relevant, and we can re-evaluate it.

@github-actions github-actions bot added the Stale label Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants