My query: Does Tyk only allows one auth method per API definition? If not, how can I achieve both Basic Auth and Auth token authentication methods for a single API in Tyk.
Your insights would be of much help.
Thanks and regards, Prashanth
Lets say that I use both Basic Auth and Auth Token as auth methods to secure my API, and I create Keys for the same. Can you tell me how I can access the API using the credentials (That i created via Keys tab in the dashboard). The website - Multiple Auth talks only about how to set up the API via Dashboard or via API definition, but not about how one can make a call to the API via a API Client (Like Postman or Thunder Client)?
Hi @James. The functionality seems to be working flawlessly. Thanks for the Support, as the Postman Support Forum and StackOverflow helped me to understand how the request is sent to Tyk Gateway for validation.
Steps followed:
Select Auth Token as the Authentication method.
Generate a Key for the API with Auth Token as the Authentication method.
Store the Key ID somewhere for later use.
Select Basic Auth as the Authentication method.
Generate username and password for Basic Auth as the Authentication method.
Encode both the values in the format (username:password) to obtain base64 value using https://www.base64encode.org/.
Store the encoded base64 value somewhere for later use.
Now Select Multiple Authentication mechanism as the Authentication method and choose Basic Auth and Auth Token as the methods.
Rename the Authentication headers as Authentication1 and Authentication2 respectively and choose any one as the Base Identity Provider.
Now open Postman or any other API Client and Include headers as Authentication1 and Authentication2 duly giving the values in the format: curl --location --request GET “http://127.0.0.1:8080/own-api/tasks” --header “Authentication1: Bearer eyJvcmciOiI2MTEwZDJjODU2YTJhYzAwMDE3YTZmMzEiLCJpZCI6IjgyZGNjMGJmYzM2ODQ1N2ZiNjdkMjQ5ODk5ZDhiMmM2IiwiaCI6Im11cm11cjY0In0=” --header “Authentication2: Basic cHJhc2hhbnRoOnF3ZXJ0eUAxMjM=”