2016-06-13 74 views
0
  1. 我有一個要求,誰願意與基本身份驗證訪問與他的證件(UN/PWD)的API或摘要身份驗證用戶身份驗證
  2. 亦通所需的憑據(UN/PWD)在請求驗證訪問後端服務

我的突觸中提取的配置是這樣的:WSO2 APIM認證

<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 

此捲曲只能採取承載令牌而是如何在捲曲

+0

您的要求是使用CURL將用戶名和密碼發送到後端,是嗎? – farasath

回答

0
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(用戶名:密碼)]通過用戶/密碼對API和用戶/密碼對後端與BASE64替換此「:用戶名密碼」

1

關於你提到的第二個問題:的 編碼字符串 的基本身份驗證向後端可以在步驟配置通用密碼在發佈實施 - >顯示更多選項 - >端點安全方案:設置爲擔保,並提供證書 (參見:https://docs.wso2.com/display/AM1100/Basic+Auth

如果必須提供用戶用戶特定的憑證應該設置「身份驗證:基本的base64(用戶名:密碼)」中HTTP標頭,標頭將傳遞給後端。

+0

嗨以上提到的基本認證。您能否介紹一下如何爲Digest驗證完成傳遞憑據以及如何配置它? – munna