我希望使用WSO2EI 6.4.0作为SOAP和REST服务身份验证平台(稍后可能是授权)的代理。我在wso2 (https://docs.wso2.com/display/EI640/Applying+Security+to+an+API)文档中找到了解决方案,但不幸的是它无法工作。
在服务定义中添加“处理程序”元素
<handlers>
<handler class="org.wso2.carbon.integrator.core.handler.RESTBasicAuthHandler"/>
</handlers>设计时(Eclipse)中的异常结果:
Invalid mediator <handler class="org.wso2.carbon.integrator.core.handler.RESTBasicAuthHandler"/> 1d6bbce1-08e3-42d5-b550-6a4e224b0028.xml /.tmp/.org.wso2.developerstudio.eclipse.esb line 15 org.wso2.developerstudio.eclipse.gmf.esb.diagram.synapseerror忽略和部署这样的API,会使API停止工作。
有人能帮忙吗?
发布于 2018-12-12 22:56:54
在WSO2EI 6.4.0中添加API基本身份验证的方式是正确的。开发者工作室会给出一个警告,正如你提到的,但它不应该是一个问题。Developer将允许设置处理程序,而不管警告如何,您应该能够创建一个包含API的复合应用程序,并将其部署到ESB。下面是一个带有RESTBasicAuthHandler的示例API。
<?xml version="1.0" encoding="UTF-8"?>
<api context="/testapi" name="testapi" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="POST" protocol="https" url-mapping="/*">
<inSequence>
<send>
<endpoint name="testapi_EP">
<http uri-template="http://localhost:8080/testapi"/>
</endpoint>
</send>
</inSequence>
<outSequence/>
<faultSequence/>
</resource>
<handlers>
<handler class="org.wso2.carbon.integrator.core.handler.RESTBasicAuthHandler"/>
</handlers>
</api>https://stackoverflow.com/questions/53724906
复制相似问题