如何在WebSphere上获得基本身份验证? [英] How do I get basic authentication working on WebSphere?

查看:116
本文介绍了如何在WebSphere上获得基本身份验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我一直在Tomcat上运行Java / Jersey Web服务,基本身份验证工作正常。我已经在项目的web.xml文件中设置了权限,用户在服务器上的tomcat-users.xml中设置了权限。工作得很好。

问题是,现在我必须将这个项目转移到WebSphere,这远远不如基本身份验证的实现那么简单。

Okay, so I've been running a Java/Jersey webservice on Tomcat with basic authentication which works perfectly fine. I've got permissions set up in the web.xml file of my project, and users set up in tomcat-users.xml on the server. Works great.
Problem is, now I have to transfer this project to WebSphere, which has nowhere near as simple of an implementation of basic authentication.

我已经看到了这个问题: Websphere 6.1和BASIC身份验证并查看了这个 pdf的第7章建议,但我似乎无法找到正确的设置(我没有像大多数方法一样使用标记为启用全局安全性的选项),并且我正在尝试运行我的项目,而pdf是非常特定于项目的。

I've seen this question: Websphere 6.1 and BASIC Authentication and looked at Chapter 7 of this pdf like suggested, but I can't seem to find the right settings (I have no option labeled 'enable global security' like most methods use), and am trying to run my project, while the pdf is extremely project specific.

所以要清楚地问我的问题,在WebSphere 6.1上启用基本身份验证的最简单方法是什么?

So to ask my question clearly, what is the easiest way to enable basic authentication on WebSphere 6.1?

推荐答案

写完之后所有这些我记得我在这里为自己写过这篇文章:

After writing all this below I remember I have blogged about this for myself here:

WebSphere 6.1和应用程序身份验证

据我所知您已正确设置web.xml:

As I understand you have setup your web.xml correctly thus:

     <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>

如果你使用的是管理控制台,你就不要说你不是这样去控制台:

This is if you are using the administration console you dont state that you are not so go to the console:

http://localhost:9060/ibm/console

然后登录(如果你有行政安全设置)

Then login (if you have administrative security setup)

然后去这里


  1. 左侧面板单击安全性

  2. 安全管理,应用程序和基础架构

  3. 那里然后是页面上的一部分应用程序安全性

  4. 选中启用应用程序安全性框

  5. 单击应用,然后保存到主配置。

  1. left hand panel click Security
  2. Secure administration, applications, and infrastructure
  3. There is then a section on the page Application security
  4. Check the box Enable application security
  5. click apply, then save to master config.

然后您启用了应用程序安全性。现在,您需要将应用程序的用户映射到websphere中的用户。

Then you have application security turned on. Now you need to map the users of your application to users within websphere.

转到此处


  1. 列表项

  2. 应用程序>企业应用程序

  3. 单击您的应用程序

  4. 在详细属性下部分您将看到链接安全角色到用户/组映射

    如果您的web.xml设置正确,您将只看到此链接

  5. 单击安全角色到用户/组映射

  6. 选择要用于身份验证的角色

  7. 单击查找用户或查找组

  8. 点击搜索并选择用户(在用户和群组菜单下设置在您的网站中

  9. 使用箭头将所选用户/群组移至右侧框

  10. 单击确定并保存到主配置。

  11. 重新启动服务器。

  1. List item
  2. Applications > Enterprise Applications
  3. Click your application
  4. Under the Detailed Properties section you will see a link Security role to user/group mapping
    you will only see this link if your web.xml is setup correctly
  5. click the Security role to user/group mapping
  6. Select the roles you wish to use for authentication
  7. Click look up users or look up groups
  8. click search and select users (that are setup in your websphere under Users and Groups menu
  9. use the arrows to move the selected users/groups to the right hand box
  10. click ok and save to master configuration.
  11. restart your server.

必须打开管理安全性(Websphere本身的安全性) rk。

Administration security (security of Websphere itself) must be turned on for it to work.

WebSphere可能很复杂,但功能强大且功能强大。

WebSphere can be complex but it is powerful and capable.

这篇关于如何在WebSphere上获得基本身份验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆