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

Getting 403 connecting to Custom Store on Laravel Forge #57

Closed
Lab385 opened this issue Oct 24, 2023 · 7 comments
Closed

Getting 403 connecting to Custom Store on Laravel Forge #57

Lab385 opened this issue Oct 24, 2023 · 7 comments

Comments

@Lab385
Copy link

Lab385 commented Oct 24, 2023

  • I've tried my luck with Shipstation support but they're insisting I'm doing it wrong.
  • Clicking the Test Connection button works, but 'Connect' returns 'Request failed with status code 403'
  • A curl with basic auth works fine.
  • Ive set up Shipping statuses and Matrix field.

As Laravel Forge runs Nginx I wonder if it's not passing the auth, so tried adding this to location in nginx conf but to no effect:

proxy_set_header Authorization $http_authorization;
proxy_pass_header  Authorization;
@johnnynotsolucky
Copy link
Contributor

@Lab385 could you provide some more information so we can investigate the issue more thoroughly:

  • Version of Craft
  • Version of Craft Commerce
  • Version of this plugin

Could you also confirm

  • that the URL you've captured in "URL to Custom XML Page" on the ShipStation custom store form matches the URL provided by the plugin in the plugins settings page
  • and, that you can make a request to the export endpoint

The plugin doesn't output an HTTP 403. If the username/password combination is incorrect you should see an HTTP 401 response instead.

A request such as the following can be used to test whether exports work correctly:

curl --location 'https://<your host>/actions/shipstationconnect/orders/process?action=export' \
  --header 'Authorization: Basic <username:password>'

The authorization header value is a base64 encoded string of username:password.

@Lab385
Copy link
Author

Lab385 commented Oct 25, 2023 via email

@johnnynotsolucky
Copy link
Contributor

@Lab385 it seems like the problem lies somewhere between your site and ShipStation. You'll need to figure out where the fault is.

As a first step, you can confirm that ShipStations requests are indeed reaching your server:

In Laravel Forge, you can view nginx logs by

  • Navigating the relevant server,
  • Selecting "Logs"
  • Then from the "View Log" drop down, choosing either Nginx Error or Nginx Access logs.

Attempt to create the connection in ShipStation, refresh the access log and verify that a new access log appears. If it errored, you should still see the log, but with an error HTTP code. Then you can have a look at the error log for potential causes.

I'm going to close this for now because it looks like it's not a problem caused by the plugin directly.

However, please reach out to me on the Craft Discord, I have the same handle as on Github, and I can assist further.

@terryupton
Copy link

Did you manage to resolve this @Lab385 as I am seeing the same issue.

@Lab385
Copy link
Author

Lab385 commented Apr 17, 2024

Did you manage to resolve this @Lab385 as I am seeing the same issue.

@terryupton it was an issue with the actual Shipstation account, from what we could see. I created a new test account, the integration worked fine, so we moved everything across.

@johnnynotsolucky
Copy link
Contributor

@terryupton what specific issue are you seeing?

The steps in the comment above should help you diagnose where the problem lies.

@terryupton
Copy link

Hey @johnnynotsolucky and @Lab385 - thanks for the replies.
I managed to resolve this by adding the .htaccess file with the following:

CGIPassAuth On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants