【发布时间】:2019-11-14 21:02:09
【问题描述】:
我们需要根据标头“Authorization: Bearer”对 REST 请求进行身份验证。我使用以下配置来启用 Mule HTTP 安全性。 默认情况下,骡子注册了“org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter”,所以我必须通过用户名和密码才能通过基本授权。 我试图覆盖 HttpBasicAuthenticationFilter 但我无法覆盖它。根据我们的要求,我们需要验证 Bearer 令牌。
能否请您提供任何指针以使“授权:承载”与 Mule 3.8 一起生效。
<spring:beans>
<spring:bean id="apiAuthenticationProvider" name="apiAuthenticationProvider" class="com.poc.ApiAuthenticationProvider" />
<ss:authentication-manager id="authenticationManager">
<ss:authentication-provider ref="apiAuthenticationProvider" />
</ss:authentication-manager>
</spring:beans>
<mule-ss:security-manager name="muleSecurityManager" doc:name="Spring Security Provider">
<mule-ss:delegate-security-provider name="memory-provider" delegate-ref="authenticationManager" />
</mule-ss:security-manager>
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081" doc:name="HTTP Listener Configuration" />
<flow name="SpringExample">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<mule-ss:http-security-filter realm="mule-realm" securityManager-ref="muleSecurityManager" />
</flow>
【问题讨论】:
-
#1 你能把日志放在
-
@JRichardsz - 感谢您的评论,我在下面提供了答案,将回答您的查询..
标签: spring spring-security mule mule-esb mulesoft