我们使用AnyPoint Studio 6.1.0开发了mule项目。我们在cloudhub中部署它们并使用https URL访问它们。如果是POST方法,我们传递JSON数据并获得响应。在这里,我们尝试为已部署的应用URL提供安全性,以便最终用户必须提供用户名和密码才能访问这些URL。
您是否可以帮助我们为部署到Cloudhub的Mule项目实施安全性。例如,基本身份验证安全机制还是其他任何一种?
答案 0 :(得分:0)
Mule使用Spring Security进行身份验证。
详细的用户指南:https://docs.mulesoft.com/mule-user-guide/v/3.8/configuring-the-spring-security-manager
这有一个您需要放入HTTP入站端点的http-security-filter
示例。
希望这有帮助
答案 1 :(得分:0)
您需要使用安全管理器来创建基本身份验证,在您的mule配置文件中使用以下spring bean。
<spring:beans>
<ss:authentication-manager alias="authenticationManager">
<ss:authentication-provider>
<ss:user-service id="userService">
<ss:user name="user" password="password" authorities="ROLE_ADMIN" />
<ss:user name="anon" password="anon" authorities="ROLE_ANON" />
</ss:user-service>
</ss:authentication-provider>
</ss:authentication-manager>
</spring:beans>
<mule-ss:security-manager>
<mule-ss:delegate-security-provider name="memory-provider" delegate-ref="authenticationManager" />
</mule-ss:security-manager>
在您的http componentsnet添加基本身份验证
之后 <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<http:basic-security-filter realm="mule-realm"/>