ZKS*_*fel 5 java websphere web-services basic-authentication websphere-6.1
好的,所以我一直在Tomcat上运行Java/Jersey Web服务,基本身份验证工作正常.我已经在项目的web.xml文件中设置了权限,用户在服务器上的tomcat-users.xml中设置了权限.效果很好.
问题是,现在我必须将这个项目转移到WebSphere,而这远远不如基本身份验证的实现那么简单.
我已经看到了这个问题:Websphere 6.1和BASIC身份验证,并查看了这个 pdf的第7章,如同建议,但我似乎无法找到正确的设置(我没有像大多数方法一样使用标记为'启用全局安全'的选项) ,我正在尝试运行我的项目,而pdf是特定于项目的.
那么要清楚地问我的问题,在WebSphere 6.1上启用基本身份验证的最简单方法是什么?
Gur*_*ard 14
写下以下所有内容后,我记得我在这里为自己写过这篇文章:
据我所知,您已正确设置web.xml:
<security-role>
<role-name>myrole</role-name>
</security-role>
<security-constraint>
<web-resource-collection>
<web-resource-name>mySec</web-resource-name>
<url-pattern>/yourUrl</url-pattern>
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
<http-method>HEAD</http-method>
<http-method>TRACE</http-method>
<http-method>OPTIONS</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>myrole</role-name>
</auth-constraint>
<user-data-constraint>
<description>SSL or MSSL not required</description>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>my login</realm-name>
</login-config>
Run Code Online (Sandbox Code Playgroud)
这是如果你使用管理控制台,你不要说你不是这样去控制台:
http://localhost:9060/ibm/console
Run Code Online (Sandbox Code Playgroud)
然后登录(如果您有管理安全设置)
然后去这里
然后打开应用程序安全性.现在,您需要将应用程序的用户映射到websphere中的用户.
到这里
必须启用管理安全性(Websphere本身的安全性)才能使其正常工作.
WebSphere可能很复杂,但功能强大且功能强大.