首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >http-security-filter在mule中不起作用

http-security-filter在mule中不起作用
EN

Stack Overflow用户
提问于 2012-11-27 19:27:55
回答 2查看 3.7K关注 0票数 1

我使用Mule Server 3.3.0 CE,生成以下代码:

代码语言:javascript
运行
复制
 <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:pattern="http://www.mulesoft.org/schema/mule/pattern"
xmlns:mule-ss="http://www.mulesoft.org/schema/mule/spring-security"
xmlns:ss="http://www.springframework.org/schema/security"
xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
    http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.3/mule.xsd
    http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.3/mule-http.xsd
    http://www.mulesoft.org/schema/mule/pattern http://www.mulesoft.org/schema/mule/pattern/3.3/mule-pattern.xsd
    http://www.mulesoft.org/schema/mule/spring-security
    http://www.mulesoft.org/schema/mule/spring-security/3.3/mule-spring-security.xsd
    http://www.springframework.org/schema/security 
    http://www.springframework.org/schema/security/spring-security-3.1.xsd">

<mule-ss:security-manager>
    <mule-ss:delegate-security-provider
        name="memory-dao" delegate-ref="authenticationManager" />
</mule-ss:security-manager>

<spring:beans>
    <ss:authentication-manager alias="authenticationManager">
        <ss:authentication-provider>
            <ss:user-service id="userService">
                <ss:user name="sepideh" password="16978413" authorities="ROLE_ADMIN" />
            </ss:user-service>
        </ss:authentication-provider>
    </ss:authentication-manager>
</spring:beans>


<pattern:web-service-proxy name="myService"
    wsdlLocation="http://ws.acme.com:6090/wsdl/weather-forecast">
    <http:inbound-endpoint address="http://localhost:8090/service">
        <mule-ss:http-security-filter realm="mule-realm" />
    </http:inbound-endpoint>
    <http:outbound-endpoint address="http://ws.acme.com:6090/weather-forecast" />
</pattern:web-service-proxy>

我运行这个项目,我有以下例外:

代码语言:javascript
运行
复制
ERROR 2012-11-27 14:31:25,456 [[web_service].connector.http.mule.default.receiver.02] org.mule.exception.DefaultMessagingExceptionStrategy: 
********************************************************************************
Message               : Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter but there was no security context on the session. Authentication denied on endpoint http://localhost:8090/service. Message payload is of type: String
Code                  : MULE_ERROR-54999
--------------------------------------------------------------------------------
Exception stack is:
1. Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter but there was no security context on the session. Authentication denied on endpoint http://localhost:8090/service. Message payload is of type: String (org.mule.api.security.UnauthorisedException)
org.mule.transport.http.filters.HttpBasicAuthenticationFilter:160 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/security/UnauthorisedException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.api.security.UnauthorisedException: Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter but there was no security context on the session. Authentication denied on endpoint http://localhost:8090/sevice. Message payload is of type: String
    at org.mule.transport.http.filters.HttpBasicAuthenticationFilter.authenticateInbound(HttpBasicAuthenticationFilter.java:160)
    at org.mule.security.AbstractEndpointSecurityFilter.authenticate(AbstractEndpointSecurityFilter.java:58)
    at org.mule.security.AbstractAuthenticationFilter.doFilter(AbstractAuthenticationFilter.java:56)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)

新的wsdl地址显示,但我不能使用此地址创建web服务。所有的解决方案都链接到this page,但我不知道如何将SoapUI更改为真实值。我应该在我的配置中更改什么?

EN

回答 2

Stack Overflow用户

发布于 2016-05-09 12:47:38

张贴这篇文章可能会对某些人有所帮助。将HTTP连接器从Mule较低版本迁移到3.6+或3.7的人(因为,我在升级时遇到了这个错误)。请点击链接https://docs.mulesoft.com/mule-user-guide/v/3.6/configuring-the-spring-security-manager(我们不能像3.3版本一样在HTTP中配置mule-realm )。当您尝试从SOAP点击它时,您会发现上面的错误Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter but there was no security context on the session。使用Mule config file.Need更改SOAPUI设置不是问题

解决此错误的两种方法:

转到SOAPUI->文件->首选项->HTTP settings->启用选项Authenticate Preemptively

在SOAPUI中设置基本身份验证时

Authorization -> Basic -> -Pre-> enable Authenticate Pre-emptively。默认情况下,它将是“使用全局首选项”,需要更改为Authenticate Pre-emptively

谢谢。

票数 3
EN

Stack Overflow用户

发布于 2013-03-27 21:11:32

看起来是相关的,你得到的错误是转移视线。即使这被记录下来,你也能得到一个成功的响应吗?http://www.mulesoft.org/jira/browse/MULE-5607

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13583208

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档