繁体   English   中英

WSO2 APIM身份验证

[英]WSO2 APIM Authentication

  1. 我需要使用基本身份验证或摘要身份验证来验证想要使用其凭据(un / pwd)访问API的用户
  2. 同时在请求中传递所需的凭据(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中传递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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM