I am Creating Tyk api with authontication. but i call url its show authontication Failed how to send username And passwrod using Url
Hi, what kind of authentication are you using?
How do you send this request?
Hi Matias, Thanks for your prompt response.
Developer is not available now.
Can you please provide some good example, so that we can try.
Thanks
It will be useful to know the authentication mechanism youâre using, so I can point you to a specific example.
The general approach for authentication mechanisms is to use HTTP headers, however itâs also possible to use query parameters or cookies in some cases.
Check the Access Control List documentation, you can see a sample GET request, that uses a HTTP header for authentication:
https://tyk.io/docs/tyk-api-gateway-v-2-0/access-control/standard-access-tokens/
actually what is default port in tyk. and â-api-auth: 53ac07777cbb8c2d53000002d698728ce964432d7167596bc005c5fcâ Where it can be located on this key
If youâve installed Tyk using one of these guides) and you have executed the commands like the examples, Tyk will be listening on port 8080.
Tyk exposes a REST API for managing all the settings, you may find the methods for retrieving and creating keys here:
https://tyk.io/docs/tyk-api-gateway-v-2-0/tyk-gateway-rest-api/
I suggest this tutorial, it covers the creation of a basic API and key (check step 5):
https://tyk.io/docs/tyk-api-gateway-v-2-0/tutorials/set-up-your-first-api/
we are using pro Edition
Acctually i do the process.
This is localhost Api Url : âhttp://localhost:9000/api/thingsâ. i want to change the External api So i Do This steps.
Note: First Thing is It possible to access to local to server. (My Code is Not Any Server or Domain. only i store in My Local system) ?.
In case is it Possible I do This steps But Its show Empty Page.
- I GO this Link âTyk.io Loginâ
- System Mgmt â apis â âADD New Apiâ Click.
- Given Api Name: âxxxâ and Target URL: âhttp:localhost:9000/api/thingsâ.
- after i save and click Import. Then its generate some api url. After i copy That Api url And Past In New Tab. But its comming Empty Page.
@rajivgandhi.vivid It sounds like you are using Tyk Cloud - if that is the case, then you wonât be able to proxy localhost as your URL will need to be publicly resolvable.
There is an exception to this rule if you are using Tyk Cloud with our hybrid mode. as @matiasb said, can you let us know how you installed Tyk?
no. we just testing on pro Edition. through online
Tyk install in Ubuntu in my local system itâs show Error.
I GIve this command : âsudo apt-get install -y mongodb-org redis-server tyk-gateway tyk-dashboardâ
Error :
Need to get 17.1 MB of archives.
After this operation, 56.9 MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
tyk-dashboard tyk-gateway
E: There are problems and -y was used without --force-yes
Hi, this problem could be related to APT and the GPG keys, can you try these commands?
For Tyk:
curl https://packagecloud.io/gpg.key | sudo apt-key add -
For Mongo:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
Finally:
apt-get update
apt-key update
Please retry the apt-get install
command right after this.
ok. i do it after what i do. is it any code written in my local file ?
after the steps run tyk â> sudo service tyk-gateway startâ. after what i do
i need to localhost url run in External using tyk
my localhost url âhttp://localhost:9000/api/bikesâ this url run to external using tyk what the process.
I try to generate new api > âhttps://vividinfotech.cloud.tyk.io/local/â using above localhost api. But Its show Empty Page.
and Itâs Show Error in console
Error:
Failed to load resource: the server responded with a status of 504 (GATEWAY_TIMEOUT)
OK, I create Api And Generate Keys
key : 57740e4905147b0001000041a7ade734459744504b4148ae4122a727
Dashboard API Key : 29c14c067c094b8f4782c2fe1e1a3e12
AppID : e9f3311cb442477761c7aceff038486f
After I Go to in my Terminal and Give this
$ curl -H âAuthorization: {57740e4905147b0001000041a7ade734459744504b4148ae4122a727}â
And Give Enter
-s
-H âContent-Type: application/jsonâ
-X POST
-d â{
âallowanceâ: 1000,
ârateâ: 1000,
âperâ: 1,
âexpiresâ: -1,
âquota_maxâ: -1,
âquota_renewsâ: 1449051461,
âquota_remainingâ: -1,
âquota_renewal_rateâ: 60,
âaccess_rightsâ: {
âYOUR-API-IDâ: {
âapi_idâ: âe9f3311cb442477761c7aceff038486fâ,
âapi_nameâ: âsample-demoâ,
âversionsâ: [âDefaultâ]
}
},
âmeta_dataâ: {}
}â
http://{https://vividinfotech.cloud.tyk.io/sample-demo/}:8080/api/29c14c067c094b8f4782c2fe1e1a3e12 | python -mjson.tool
After I get This Error What The Reason And How To Solve.
http://{https://vividinfotech.cloud.tyk.io/sample-demo/}:8080/api/29c14c067c094b8f4782c2fe1e1a3e12 | python -mjson.tool
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:â:-- --:â:-- --:â:-- 0curl: (6) Could not resolve host: https
No JSON object could be decoded
Is your endpoint publicly accesible?
No. But I give the command itâs showing.
No JSON object could be decodeded
What The Reason
This One Correct Are Wrong
curl -H âAuthorization: {57740e4905147b0001000041a7ade734459744504b4148ae4122a727}â
And Give Enter
-s
-H âContent-Type: application/jsonâ
-X POST
-d â{
âallowanceâ: 1000,
ârateâ: 1000,
âperâ: 1,
âexpiresâ: -1,
âquota_maxâ: -1,
âquota_renewsâ: 1449051461,
âquota_remainingâ: -1,
âquota_renewal_rateâ: 60,
âaccess_rightsâ: {
âYOUR-API-IDâ: {
âapi_idâ: âe9f3311cb442477761c7aceff038486fâ,
âapi_nameâ: âsample-demoâ,
âversionsâ: [âDefaultâ]
}
},
âmeta_dataâ: {}
}â
http://{https://vividinfotech.cloud.tyk.io/sample-demo/}:8080/api/29c14c067c094b8f4782c2fe1e1a3e12 | python -mjson.tool
Can you run the curl
comand without the Python pipe and using the verbose mode and corresponding authorization headers?
curl --verbose -H "Authorization: abc" http://your_api_endpoint
And then the same command, but targeting your endpoint directly. You probably donât need authorization headers for this:
curl --verbose http://your_endpoint
This could give me a clearer perspective.
Thanks, i give This
curl --verbose -H âAuthorization: abcâ http://your_api_endpoint
Comming On Json Out Put. After i go Apis â Edit ->Base Configuration â Enable round-robin load balancing âcheck Fieldâ â Add LB targets.
After Comming This Url
Upstream targets:
http://jsonplaceholder.typicode.com/users
i try To this Url Its Get Out in Json. Format. Thanks. That it Are Any Other Work Doing Here.
Yesterday I Register New User In TYK.IO . After Login
In Menu Bar Under âSYstem Managmentâ. Show Lot Of Sub Menuâs.
But To Day I Login Its Show only Apiâs.
I Click Apis - >Edit Its Show Error.
!Error
Not authorised
itâs Display in Alert Box. What The Reason.