Request a token and insert it in a requestv3.10+

Configure the Request Callout plugin to:

  • Send a request to an API to get a token
  • Use the token in the request to the upstream server

In this example, we expect the API request to return a response body containing a token field. We can then use the value of this field with $(callouts.auth1.response.body.token).

Environment variables

  • API_URL: The API endpoint to use to request a token.

Set up the plugin

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!