wso2 - 无法通过 WSO2 EI 访问安全的后端服务
问题描述
我的要求是通过 WSO2 EI 6 调用安全的后端服务,所以我尝试如下添加属性中介和标头中介,但我无法访问安全 API。
<header name="Authorization" scope="transport" value="Bearer 1e127891-c430-3312-87ab-a2ba23ef8a4d"/>
整个 API 如下所示,
<?xml version="1.0" encoding="UTF-8"?>
<api context="/nexgen" name="ChainApis" publishSwagger="nexgen" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="GET" uri-template="/getProviders">
<inSequence>
<header name="Authorization" scope="transport" value="Bearer 1e127891-c430-3312-87ab-a2ba23ef8a4d"/>
<send>
<endpoint key="LdapTest"/>
</send>
</inSequence>
<outSequence>
<log>
<property name="checklist" value="after call"/>
</log>
<send/>
</outSequence>
<faultSequence/>
</resource>
</api>
Endpoint 如下所示。
<endpoint name="LdapTest" xmlns="http://ws.apache.org/ns/synapse">
<http method="get" uri-template="https://******/***/1.0/getLdapUserData?userName=suresh">
<suspendOnFailure>
<initialDuration>-1</initialDuration>
<progressionFactor>1.0</progressionFactor>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>0</retriesBeforeSuspension>
</markForSuspension>
</http>
</endpoint>
I even tried with the below property mediator too
<property expression="fn:concat('Bearer ', 'db9df6c0-dfd4-3fde-ba0f-b9a524f0c9b0')" name="Authorization" scope="transport" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
the below is the log i get in my log file.
TID: [-1234] [] [2020-02-07 14:35:56,703] INFO {org.apache.synapse.mediators.builtin.LogMediator} -
To: /nexgen/getProviders, MessageID: urn:uuid:c0409753-deb4-4c28-8d1e-23db599b4296,
Direction: request, Envelope:
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body/>
</soapenv:Envelope>
{org.apache.synapse.mediators.builtin.LogMediator}
解决方案
推荐阅读
- java - Java - 计算重力加速度
- java - 当 KTable 有更新时,KTable 和 KStream join 是否会发布新记录?
- c# - 禁用特定的 C# 9 源代码生成器
- google-sheets - 在 Google 表格中的一系列值之间动态查找一个值
- reactjs - 如何在这个简单的选择中获取选定的值
- python - 共线特征及其对线性模型的影响,任务:1 Logistic Regression
- python - 按索引组合列表和嵌套列表
- javascript - 每天根据 JavaScript 结果更新数据库中的年龄列
- r - geom_col 显示不正确的值数
- ms-access - MS Access - 级联第二个组合框不级联