我正在尝试使用Websphere 7.0对我的Web服务进行基本身份验证。
我试过在web中创建用户和组以及在web.xml中声明安全角色
但是问题是将用户映射到我的Web服务提供商应用程序。
这是正确的方法还是有更好的方法进行基本身份验证使用7.0
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<security-constraint>
<display-name>Constraint-0</display-name>
<web-resource-collection>
<web-resource-name>Constraint-0</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>test</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<security-role>
<role-name>test</role-name>
</security-role>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
</web-app>