Google App Engine安全约束不起作用 [英] Google App Engine Security Constraint is not working

查看:99
本文介绍了Google App Engine安全约束不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在用于Java的Google App Engine(GAE)上部署的我的GWT应用程序的部署描述符中使用以下安全性约束:

 <安全约束> 
< web-resource-collection>
< url-pattern> ds / *< / url-pattern>
< / web-resource-collection>
< auth-constraint>
<角色名称>管理员< /角色名称>
< / auth-constraint>
< / security-constraint>

我的应用正在使用Google帐户进行身份验证。

它在托管模式(Eclipse)中工作得非常好,但是当我将应用程序部署到GAE时,约束不起作用。例如,在托管模式下,当我尝试访问ds文件夹中的资源时,它将我重定向到登录页面。登录后,它只允许访问管理员用户。但是在部署的应用程序中,任何人都可以在没有任何认证/授权的情况下访



我没有机会在应用程序的默认版本(http://myappid.appspot.com)上进行测试,但它肯定不会不适用于其他版本(如 http://5.myappid.appspot.com )。

我在这里错过了一些明显的东西吗?



谢谢。

解决方案

我以为你需要 / ds / * 。您的示例没有前面的斜杠。


I'm using the following security constraint in the deployment descriptor of my GWT app, which is deployed on Google App Engine (GAE) for Java:

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

My app is using Google Accounts for authentication.

It works perfectly fine in the hosted mode (Eclipse), but when I deploy the app to GAE, the constraint doesn't work. For example, in the hosted mode, when I try to access a resource in the ds folder, it redirects me to the login page. After login, it gives access to admin users only. But in the deployed app, anyone can access the resource without any authentication / authorization.

I haven't had a chance to test this on the "default" version of the app (http://myappid.appspot.com), but it surely doesn't work on other versions (like http://5.myappid.appspot.com).

Am I missing something obvious here?

Thanks.

解决方案

I'd have thought you needed /ds/* . Your example doesn't have a preceding slash.

这篇关于Google App Engine安全约束不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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