【发布时间】:2019-02-19 15:19:12
【问题描述】:
我正在使用 WSO2 EI 6.3.0 和 WSO2 Developer Studio 3.8.0。
我正在使用 ESB 项目和其中的代理服务。
代理服务是一个简单的直通服务; 它接收来自 webapp 的请求并将其转发给 Soap Web Service,从 WS 获取响应并给出 它返回到网络应用程序。
我按照这个教程实现了这个配置:
https://youtu.be/3OsuGhEMQgc
设置非常简单,一切正常,直到我发现 端点具有 http 基本身份验证的 Web 服务。
感谢这篇文章,我让它工作了:
https://medium.com/@Jenananthan/wso2-esb-how-to-invoke-basic-auth-protected-endpoint-service-5bcdd8290cb4
下面是描述代理服务的xml:
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="ProxyWithBasicAuth" startOnLoad="true" trace="disable" transports="https" xmlns="http://ws.apache.org/ns/synapse">
<target>
<endpoint name="endpoint_urn_uuid_xxxxxxxx-yyyy-zzzz-1111-234567892345">
<address trace="disable" uri="https://here.goes.the.uri.of.the.ws.endpoint"/>
</endpoint>
<inSequence>
<property value="this_is_the_username" name="username" scope="default" type="STRING"/>
<property value="this_is_the_password" name="password" scope="default" type="STRING"/>
<property expression="fn:concat($ctx:username,':',$ctx:password)" name="credentials" scope="default" type="STRING"/>
<property expression="fn:concat('Basic ', base64Encode($ctx:credentials))" name="Authorization" scope="transport" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
</inSequence>
<outSequence>
<send/>
</outSequence>
<faultSequence/>
</target>
</proxy>
所以,这个配置(xml 文件)正在工作,但我写了所有 无需使用 gui 的任何可视或拖放元素即可启用基本身份验证的部分。
我的问题是:
1) 这是在代理服务上设置基本身份验证的正确方法吗?
2) 是否存在任何允许直观地进行此设置的 gui(拖放)元素?
注意:我不需要在 “客户”和 ESB 代理服务;这个问题是关于基本的 ESB 代理服务和“外部”Web 服务之间的身份验证。
【问题讨论】:
-
你能帮忙让它工作吗?我复制了你的代理,但我不知道如何测试它?无论是否具有基本身份验证,它都可以正常工作
标签: wso2 wso2esb basic-authentication wso2ei wso2developerstudio