只需按照本文中的步骤为7.1设置BASIC身份验证即可。
尝试这个。
组态Web.xmljboss-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>
standalone.xml<jboss-web> <security-domain>java:/jaas/other</security-domain></jboss-web>
如果您正在使用 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>
这对我有用
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)