bluemix上的基本身份验证

时间:2014-10-05 07:11:02

标签: cloud websphere-liberty ibm-cloud

我正在尝试在BlueMix Liberty Profile上部署Web应用程序,我想在此应用程序上启用基本HTTP身份验证。

该应用似乎运行正常,但没有web.xml更改或更新允许我做基本或基于表单的身份验证。

1 个答案:

答案 0 :(得分:1)

有关启用自由安全性的详细信息,请参阅Liberty指南 - 简而言之,您需要编辑web.xml并添加所需的安全性约束。

示例:

<security-role>
  <role-name>restricted</role-name>
</security-role>
<security-constraint>
  <web-resource-collection>
    <web-resource-name>Web Application</web-resource-name>
    <url-pattern>/*</url-pattern>
  </web-resource-collection>
  <auth-constraint>
    <role-name>restricted</role-name>
  </auth-constraint>
</security-constraint>
<login-config>
  <auth-method>BASIC</auth-method>
  <realm-name>Restricted area</realm-name>
</login-config>

完成后,您需要在Liberty中设置基本身份验证注册表和角色映射 - http://www-01.ibm.com/support/knowledgecenter/SS7JFU_8.5.5/com.ibm.websphere.wlp.express.doc/ae/twlp_sec_basicreg_full.html?cp=SS7JFU_8.5.5%2F1-3-11-0-4-0-1

最后,您需要使用完整的自由服务器重新部署您的应用,请参阅https://www.ng.bluemix.net/docs/#starters/liberty/index.html#optionsforpushinglibertyapplications&#34;推送Liberty Server&#34;对此。

相关问题