【发布时间】:2011-11-29 21:03:46
【问题描述】:
问题定义:
我们有一个面向公众的 tomcat,我们希望仅在面向 tomcat 的产品上使用单一密码保护 web 应用程序。这可以通过向生产 tomcat-users.xml 添加一个新的用户和角色并将相应的和部分添加到 webapps WEB-INF/web.xml 来完成
问题是,因为您必须更改实际的 webapp,这意味着使用 eclipse 的开发人员无法访问该站点,除非他们删除这些行并记住在发布之前重新应用它们。无法编辑 eclipse tomcats tomcat-users.xml(在 workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf 中找到,因为它会在您停止/启动 tomcat 时被覆盖。
问题:
有没有其他方法只在服务器上进行身份验证,或者让用户进入 eclipses tomcat?
以下是进入 web.xml 的内容:
<security-constraint>
<web-resource-collection>
<web-resource-name>
Entire Application
</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>gamer</role-name>
</auth-constraint>
</security-constraint>
<!-- Define the Login Configuration for this Application -->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Invigation only</realm-name>
</login-config>
【问题讨论】:
标签: eclipse tomcat basic-authentication