1

I am building a small app engine project connected to Android and Iphone devices. I want only the users who has the Google account has to access my http://myuser.appspot.com... Whenever they post something, I want to grab their gmail id and associate with the message that they post using http://myuser.appspot.com... I dont want some one to post junk messages though I perform a validation, but still I want to collect the gmail user id for further reference. I tried adding this web.xml, but it is not forcing me to enter my gmail id before the page shows up,

<security-constraint>
    <web-resource-collection>
        <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <role-name>*</role-name>
    </auth-constraint>
</security-constraint>

Thanks, Ramesh

4

2 回答 2

0

该配置看起来应该没问题。

您已经登录 Google 了吗?如果是这样,它应该只是自动获取身份验证,您无需再次登录。尝试注销,然后访问该页面。

于 2013-06-28T17:44:37.950 回答
0

我找到了解决这个问题的方法,这可能不是正确的方法,但我尝试了所有可能的方法并得出了这个结论,而不是对所有页面进行身份验证约束,当我为第一页做时,它总是无法连接.

<security-constraint>
    <web-resource-collection>
        <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <role-name>*</role-name>
    </auth-constraint>
</security-constraint>

我正在为特定页面做,并在我的第二页上通过 onLoad 验证后重定向到第一页。

如果您找到更好的解决方案,请发布。

于 2013-07-11T21:48:23.323 回答