Help how to reverse proxy to a target url that has auth and query parameters

I am following instructions at https : // tyk.io/docs/getting-started/create-api/ and I successfully setup tyk and can successfully communicate with postman to tyk api and add apis.

However I am unable to setup the correct configuration for this endpoint:
http://username:[email protected]:80/api?do=start&Location=one&Key=12345

Initially I tried this

 "proxy": {
    "listen_path": "/test-api/",
    "target_url": "http://username:[email protected]:80/api?do=start&Location=one&Key=12345",
    "strip_listen_path": true
  },

and I have been reading documentation and testing more configuration and I am unable to find the correct setup.

How can I reverse proxy a user over wan to tyk at for example https://tykurl.com/test-api/ and for tyk to perform POST the auth and query parameters to one specific url endpoint with preconfigured parameters http://username:[email protected]:80/api?do=start&Location=one&Key=12345

Thank you

Hi @chrislawso welcome to the community! :tada:
We normally pass Basic Authentication credentials using the (1.) request header (e.g. Authorization), (2.) cookie, or (3.) query parameters which can be proxied to your upstream service.

An example cURL to your Tyk API would look like this if you’re using the Authorization request header. Please take note that the credentials (username:password) are base64 encoded:

curl http://localhost:8080/basicauth/get \
  --header "Authorization: Basic $(echo -n 'myusername:mypassword' | base64)"
<200 response>

Please give this a try and let us know if you have any follow up questions. Thanks!