[英]WSO2 APIM Authentication
我的突觸提取配置如下所示:
<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中傳遞user / pwd作為API,如何傳遞user / pwd作為后端
關於第二個問題:對於后端的基本身份驗證,您可以在“實施->顯示更多選項->終端安全方案”步驟中在發布者中配置常規密碼 :設置為“安全”並提供憑據(請參閱: https://docs.wso2 .com / display / AM1100 / Basic + Auth )
如果必須提供用戶特定的憑據 ,則用戶應在HTTP標頭中設置“身份驗證:基本base64(username:password)”,標頭將傳遞到后端。
curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" --header "Authorization: **Basic** **[base64encode(username:password)]**" -d "{}" http://<IP address of APIM Server>:8280/Zeno1/1.0.0/payment/name
[base64encode(username:password)]替換為“ username:password”的base64編碼字符串
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.