问题描述
我想端口从Tomcat到WebSphere一个J2EE应用程序,我不是太熟悉WebSphere。
我遇到的唯一的问题是授权(我在web.xml中使用基本身份验证)。在Tomcat中我用的是tomcat-users.xml文件来定义我的用户名/密码和他们属于什么样的角色。
我如何在WebSphere这样做简单?当部署EAR到WebSphere还问我从web.xml中我的角色映射到用户或组。
我必须建立某种境界?定制用户注册表?
感谢。
更新:
我配置了一个独立定制注册表,但是我不能得到一个登录提示用户名/密码。它的工作原理在Tomcat中蛮好的,它的Websphere不一样。
从web.xml中code
<安全约束>
<网上资源收集和GT;
<网上资源名称>基本认证安全< /网络资源名称>
< URL模式> / *< / URL模式>
< /网上资源收集和GT;
< AUTH约束>
<角色名称>&HELLO_USER LT; /角色名称>
< / AUTH约束>
<使用者数据约束>无< /用户数据约束>
< /安全约束>
<登录名,配置>
< AUTH-方法>&BASIC LT; / AUTH-方法>
< /登录,配置>
<安全角色>
<角色名称>&HELLO_USER LT; /角色名称>
< /安全角色>
在WAS是不是默认启用的应用程序安全性。
在管理控制台,请访问:安全 - > 全局安全性并确保启用应用程序安全性复选框被选中。
您可能需要保存更改后重新启动服务器。
I am trying to port a J2EE app from Tomcat to Websphere and I'm not too familiar with Websphere.
The only problem I am having is authorization (I use basic-authentication in my web.xml). In Tomcat I use the tomcat-users.xml file to define my users/passwords and to what roles they belong.
How do I do this "simply" in Websphere? When deploying the EAR to Websphere it also asks me to map my role from web.xml to a user or group.
Do I have to set up some sort of realm? Custom user registry?
Thanks.
UPDATE:
I configured a Standalone custom registry, however I can't get a log-in prompt for username/password. It works just fine in Tomcat, and it doesn't in Websphere.
Code from web.xml
<security-constraint>
<web-resource-collection>
<web-resource-name>basic-auth security</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>HELLO_USER</role-name>
</auth-constraint>
<user-data-constraint>NONE</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<security-role>
<role-name>HELLO_USER</role-name>
</security-role>
Application security on WAS isn't enabled by default.
In the Admin Console, go to: Security -> Global Security and make sure the Enable application security check-box is checked.
You may need to restart the server after saving changes.
这篇关于7的Websphere简单的境界(如Tomcat-users.xml中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!