【发布时间】:2016-06-21 14:40:25
【问题描述】:
- 我需要通过基本身份验证或摘要式身份验证对想要使用其凭据 (un/pwd) 访问 API 的用户进行身份验证
- 还在请求中传递所需的凭据(un/pwd)以验证对后端服务的访问权限
我的突触提取配置如下所示:
<filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
<then>
<property name="api.ut.backendRequestTime"
expression="get-property('SYSTEM_TIME')"/>
<property name="password"
expression="wso2:vault-lookup('PayAdmin-- ZenoAPI51.0')"/>
<property name="unpw"
expression="fn:concat('user',':',get-property('password'))"/>
<property name="Authorization"
expression="fn:concat('Basic ', base64Encode(get-property('unpw')))"
scope="transport"/>
<send>
<endpoint name="PayAdmin--ZenoAPI5_APIproductionEndpoint_0">
<http uri-template="http://localhost:8080/payment/{uri.var.name}"/>
</endpoint>
</send>
</then>
我想知道的是:
curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" --header "Authorization: Bearer 2e13c9b3c8717f43d093cfc7c63994bb" -d "{}" http://<IP address of APIM Server>:8280/Zeno1/1.0.0/payment/name
此 curl 只能获取不记名令牌,但如何在 curl 中为 API 传递用户/密码和为后端传递用户/密码
【问题讨论】:
-
您的要求是使用 CURL 将用户名和密码发送到后端,对吗?