You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "sanjibnarzary (via GitHub)" <gi...@apache.org> on 2025/05/02 15:26:47 UTC
Re: [I] In the KeyAuth Plugin I would like to add key_prefix header Bearer in APIKey Header ["Authoirization"] authentication [apisix-ingress-controller]
sanjibnarzary commented on issue #2345:
URL: https://github.com/apache/apisix-ingress-controller/issues/2345#issuecomment-2847491078
The APISix works with `Authorization: apikey` however some openai compatible library added Bearer before apikey. So if you want like that then you may achieve it by using rewrite plugin in the route to make `Authorization: Bearer apikey` to `Authorization: apikey`
```
{
"uri": "/your/api/path",
"plugins": {
"proxy-rewrite": {
"request_headers": {
"Authorization": {
"rewrite": {
"regex": "Bearer\\s+(.*)",
"replace": "$1"
}
}
}
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"your.upstream.service.com:8080": 1
}
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org