help request: how to pick up username/password from consumer when accessing API? #7510
Replies: 3 comments 2 replies
-
If you are talking about passing consumer name upstream, see: #4078 (comment) and |
Beta Was this translation helpful? Give feedback.
-
您说得这种方式可以将信息写在headers中,但是不能动态变化。
我想实现在发送A请求之前先发送一个获取token的请求B,然后将token作为参数动态拼接在A请求之上,
您知道这个怎么处理吗?
…------------------ 原始邮件 ------------------
发件人: "apache/apisix" ***@***.***>;
发送时间: 2022年7月20日(星期三) 上午9:52
***@***.***>;
***@***.******@***.***>;
主题: Re: [apache/apisix] help request: how to pick up username/password from consumer when accessing API? (Issue #7496)
If you are talking about passing consumer name upstream, see: #4078 (comment)
and basic-auth plugin has hide_credentials attributes, set true to pass the authorization request headers to the Upstream.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
It looks like you need to implement it yourself. Construct the http request during the authentication process, get the response and then modify the parameters of the current request. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
大佬好,我有这样一个需求:我使用了basic-auth插件作权限过滤,consumer中注册了用户,然后在路由中需要去访问其他的服务接口,需要将basic-auth插件中的username和password取出来,作为访问后面的路由的参数传递过去,即要对参数进行一次包装,请问这需要怎么去处理?
Environment
apisix version
):2.12.1uname -a
):Linux bogon 3.10.0-1160.el7.x86_64 change: added doc of how to load plugin. #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linuxopenresty -V
ornginx -V
):curl http://127.0.0.1:9090/v1/server_info
):luarocks --version
):Beta Was this translation helpful? Give feedback.
All reactions