shopify-app-template-node icon indicating copy to clipboard operation
shopify-app-template-node copied to clipboard

Using Postman to test backend endpoints

Open 1000p opened this issue 2 years ago • 2 comments

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?

1000p avatar Apr 15 '23 15:04 1000p

Hey did you find a solution to this?

SachinBahukhandi avatar Jan 27 '24 07:01 SachinBahukhandi

Hey did you find a solution to this?

Unfortunately, no.

1000p avatar Jan 27 '24 11:01 1000p