我的应用程序有一个安全限制:
<security-constraint>
<display-name>users</display-name>
<web-resource-collection>
<web-resource-name>all</web-resource-name>
<description/>
<url-pattern>/secured</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>HEAD</http-method>
<http-method>PUT</http-method>
<http-method>OPTIONS</http-method>
<http-method>TRACE</http-method>
<http-method>DELETE</http-method>
</web-resource-collection>
<auth-constraint>
<description>Have to be a USER</description>
<role-name>USERS</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<security-role>
<description/>
<role-name>USERS</role-name>
</security-role>然而,在运行时,没有领域“用户”:
09-06-15 10:25:42.536:警告:请求/secured失败-没有领域
联合开发的。
发布于 2009-06-17 10:13:53
我添加了web.xml/jetty-web.xml:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.1//EN"
"http://jetty.mortbay.org/configure_1_2.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<Get name="securityHandler">
<Set name="userRealm">
<New class="org.mortbay.jetty.security.HashUserRealm">
<Set name="name">MyRealm</Set>
<Call name="addUserToRole">
<Arg>dfa</Arg>
<Arg>*</Arg> <!-- * is a "builtin" realm for GAE -->
</Call>
<Call name="put">
<Arg>dfa</Arg>
<Arg>secret</Arg>
</Call>
</New>
</Set>
</Get>
</Configure>这是正确部署在GAE上的。然而,当我试图获得/secured时,会出现一个普通的表单http,但“dfa//secured”却不被识别。
是个虫子?
https://stackoverflow.com/questions/995035
复制相似问题