Shopify / shopify-app-template-node

MIT License
890 stars 402 forks source link

Using Postman to test backend endpoints #1259

Open 1000p opened 1 year ago

1000p commented 1 year ago

Our express application is started listening on a PORT. Using it I can call localhost:PORT/api/endpoint . This of course fails if I do not provide a valid Bearer token. Inspecting network calls to my application from the store admin uses Bearer authentication with JWT token that changes every time I reload the app screen or every one minute. Using it the request succeeds.

I have couple of questions:

  1. The aforementioned PORT is changing every time the application is restarted. Checking the Ngrok tunnel forwarding address the port seems to differ. Why it differs? Is there a way of making this port static for local developments? How? (Multiple questions but related, sorry)
  2. From what I understood the flow is as follow: User enters the app screen (in the Admin panel) -> FE loads skeleton-> FE sends request to app bridge -> app bridge grants session token (JWT) to FE -> FE uses token to authenticate with app BE. Any way to create a session token that does not expire or has a long expiration time so I can fire requests from Postman more easily?
SachinBahukhandi commented 10 months ago

Hey did you find a solution to this?

1000p commented 10 months ago

Hey did you find a solution to this?

Unfortunately, no.