【发布时间】:2019-09-04 08:11:48
【问题描述】:
我正在使用 WSO2 Enterprise Integrator 6.5.0(最新)
我需要通过代理服务(SOAP、REST)启用 HTTP 基本身份验证
我尝试过以下资源 - WSO2 EI and WSO2 Developer - Setup an ESB Proxy with http basic authentication
<?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>
但它不起作用? 当我发送错误的凭据时,我期待,
代理服务会给我错误吗?
【问题讨论】:
-
您是在尝试调用中间有代理服务器的服务,还是只是需要基本身份验证的服务?如果它带有代理,您还必须在axis2.xml 中设置它。如果不启用连线日志docs.wso2.com/display/EI600/Debugging+Mediation 并检查是否设置了标头。
-
true -
@Martin Hald 在axis2.xml 这些配置代码行被注释了吗?应该取消注释吗?
-
如果你的 wso2 和后端之间有代理服务器,是的,那么你应该取消注释并配置它。
标签: wso2 wso2esb wso2-am wso2carbon wso2ei