我正在使用j_security_check我的 struts web 项目,并将它部署在 jboss 中。
在我web.xml定义的角色中testuser,创建了一个 jar 文件,其中包含users.propertiesjar名称roles.properties作为应用程序的名称。TestUserInfo.jarTest
我的web.xml:
<security-constraint>
<display-name>To secure Test site</display-name>
<web-resource-collection>
<web-resource-name>test_actions</web-resource-name>
<url-pattern>*.action</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>testuser</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>test offshore realm</realm-name>
<form-login-config>
<form-login-page>/login_form.jsp</form-login-page>
<form-error-page>/login_error.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>testuser</role-name>
</security-role>
users.properties文件具有username=password名称值对,roles.properties并将username=role(在我的情况下user=testuser)作为名称值对。
users.properties当应用程序部署在 JBoss中时,我可以使用文件中的用户名和密码登录。TestUserInfo.jar保存在jboss-5.1.0.GA\jboss-5.1.0.GA\server\default\lib.
我必须在 websphere 中做什么才能实现相同的功能?