key-auth authentication for query param in url #13089
Replies: 2 comments
-
|
Hi @hexasubhash! I'm Dosu and I’m helping the apisix team. The key-auth plugin should work with query parameters out of the box since Most likely issue: key-auth configured in consumer_group If you've placed the Correct setup:
curl "http://127.0.0.1:9180/apisix/admin/consumers" -X PUT -d '{
"username": "myuser",
"plugins": {
"key-auth": {
"key": "key"
}
}
}'
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT -d '{
"uri": "/myservice/v1",
"plugins": {
"key-auth": {}
},
"upstream": { ... }
}'
Could you share your consumer and route configurations? That would help identify the specific issue. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
You'll want to use this config inside the "key-auth": {
"query": "apikey"
}If you also for example use the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How to authenticate the apikey from the query param of url ? my URL is https://host/myservice/v1?apikey=key, have configured in plugins , consumer and as in route, stil am getting auth failed error.
Beta Was this translation helpful? Give feedback.
All reactions