bluemix上的基本认证 [英] Basic Auth on bluemix

查看:454
本文介绍了bluemix上的基本认证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在BlueMix Liberty Profile上部署Web应用程序,并且我要对此应用程序启用基本HTTP身份验证。

I am trying to deploy a web application on BlueMix Liberty Profile and I want to enable Basic HTTP authentication on this application.

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

The app seems to be running fine, but no web.xml changes or updates allow me to do basic or form based auth.

推荐答案

请参阅Liberty指南 - 简而言之,您需要编辑web.xml并添加所需的安全限制。

For details on enabling security on liberty refer to Liberty guide - in short you would need to edit your web.xml and add the required security constraints.

示例:

<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中设置基本的auth注册表和角色映射 - a href =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-1rel =nofollow> 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

Once you have that done, you would need to setup basic auth registry and role mapping in 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

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

And finally, you would need to redeploy your app with the complete liberty server, see https://www.ng.bluemix.net/docs/#starters/liberty/index.html#optionsforpushinglibertyapplications "Pushing Liberty Server" for this.

这篇关于bluemix上的基本认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆