These instructions assume you have an API with the settings specified in quickstart.json
(see below).
To add this token, save the JSON contents as token.json
, then:
curl http://127.0.0.1:8080/tyk/keys/abc -H 'x-tyk-authorization: 352d20ee67be67f6340b4c0605b044b7' -H 'Content-Type: application/json' -d @token.json
Where abc
, in the URL, is your existing key.
x-tyk-authorization
is the Tyk gateway secret, found in tyk.conf
.
After this steps, the following request will fail (the key doesn't exist):
curl http://127.0.0.1:8080/quickstart/headers -H 'Authorization: invalid123'
And if you use your new key:
curl http://127.0.0.1:8080/quickstart/headers -H 'Authorization: abc'