栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

如何在Jboss7.1中配置简单身份验证

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

如何在Jboss7.1中配置简单身份验证

只需按照本文中的步骤为7.1设置BASIC身份验证即可。

尝试这个。

组态

Web.xml

<security-constraint>    <web-resource-collection>        <web-resource-name>All Access</web-resource-name>        <url-pattern>/*</url-pattern>        <http-method>DELETe</http-method>        <http-method>PUT</http-method>        <http-method>HEAD</http-method>        <http-method>OPTIONS</http-method>        <http-method>TRACE</http-method>        <http-method>GET</http-method>        <http-method>POST</http-method>    </web-resource-collection>    <user-data-constraint>        <transport-guarantee>CONFIDENTIAL</transport-guarantee>    </user-data-constraint></security-constraint><login-config>    <auth-method>BASIC</auth-method>    <realm-name>ApplicationRealm</realm-name></login-config><security-role>    <role-name>user</role-name></security-role>

jboss-web.xml

<jboss-web>    <security-domain>java:/jaas/other</security-domain></jboss-web>

standalone.xml

如果您正在使用 ApplicationRealm, 则无需执行任何操作。

新增使用者

您可以使用jboss提供的工具将用户添加到 ApplicationRealm

%JBOSS_HOME%/ bin中 。使用 add-user.bat(或)add-user.sh 工具。

C:devjboss-eap-6.2bin>add-userWhat type of user do you wish to add? a) Management User (mgmt-users.properties) b) Application User (application-users.properties)(a): bEnter the details of the new user to add.Using realm 'ApplicationRealm' as discovered from the existing property files.Username : johngaltPassword :Re-enter Password :What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[  ]: userabout to add user 'johngalt' for realm 'ApplicationRealm'Is this correct yes/no? yesAdded user 'johngalt' to file 'C:devjboss-eap-6.2standaloneconfigurationapplication-users.properties'Added user 'johngalt' to file 'C:devjboss-eap-6.2domainconfigurationapplication-users.properties'Added user 'johngalt' with groups user to file 'C:devjboss-eap-6.2standaloneconfigurationapplication-roles.properties'Added user 'johngalt' with groups user to file 'C:devjboss-eap-6.2domainconfigurationapplication-roles.properties'Is this new user going to be used for one AS process to connect to another AS process?e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.yes/no? noPress any key to continue . . .C:devjboss-eap-6.2bin>

这对我有用



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/466639.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号