【问题标题】:HTTP POST to a REST service that's secured by CAS using MuleHTTP POST 到 CAS 使用 Mule 保护的 REST 服务
【发布时间】:2015-06-30 17:20:14
【问题描述】:

我正在尝试使用 Mule 3.5.0 CE 将 xml 字符串发布到 CAS 后面的 REST 服务。我已经在出站端点上配置了 mule 安全管理器和 http 安全过滤器,但没有取得多大成功。 mule 文档并没有太大帮助,我遇到了一些关于如何保护入站端点的帖子,但没有关于验证出站请求的内容。以前有没有人这样做过,甚至有可能吗?提前致谢。

<!-- CONNECTORS -->
<https:connector name="HttpsConnector">
    <service-overrides sessionHandler="org.mule.session.NullSessionHandler"/>
    <https:tls-server path="${truststore}" storePassword="password"/>
</https:connector>


<!-- ENDPOINTS -->
<https:endpoint name="PublishEndpoint" connector-ref="HttpsConnector"
    address="${my.url}" 
    method="POST" contentType="application/xml" exchange-pattern="request-response"
    keepAlive="true" />

<mule-ss:security-manager>
    <mule-ss:delegate-security-provider name="memory-provider" 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="${user}" password="${pwd}" authorities="ROLE_USER" />
            </ss:user-service>
        </ss:authentication-provider>
    </ss:authentication-manager>
</spring:beans>

<!-- publish xml string to service -->
<flow name="PublishFlow">
    <vm:inbound-endpoint ref="ReportEndpoint" />
    <https:outbound-endpoint ref="PublishEndpoint">
        <mule-ss:http-security-filter realm="mule-realm" securityProviders="memory-provider"/>
    </https:outbound-endpoint>
</flow>

【问题讨论】:

  • http-security-filter 用于入站端点,而不是出站端点。 CAS 期望什么样的凭据?只是 Basic Auth 授权标头中的用户名和密码?还有什么?
  • @DavidDossot CAS 首先需要用户名/密码才能启动身份验证过程。然后有一些交换票恰好完成验证。
  • 您可以使用 https:outbound-endpoint 上的同名属性传递用户名/密码。但这不会做“少数交换票”。

标签: authentication https mule cas outbound


【解决方案1】:

CAS 安全方案不是由 HTTP 请求者直接实现的,实际上在 3.5.0 中只支持非抢占式 BASIC 身份验证。

最好的办法是回滚到 http:oubound 端点并创建一个自定义调度程序来处理 java 代码的身份验证。

【讨论】:

    猜你喜欢
    • 2016-04-29
    • 2012-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-08
    • 2017-05-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多