GAE + GWT无身份验证的Servlet

3

我正在使用Google App Engine和GWT开发Web应用程序。

我正在使用Google账户提供的身份验证,因此我的web.xml文件包含以下内容:

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

我需要一个特定的servlet不受Google身份验证的限制,因为它将被Android设备调用。请不要建议身份验证设备的方法,因为这不符合我的需求。

我该如何设置我的项目,以便所有内容都受到身份验证的保护,只有一个servlet不受保护?

1个回答

0
为什么你不能只是:
1)修改约束的URL
<security-constraint>
    <web-resource-collection>
        <url-pattern>/protected/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <role-name>*</role-name>
    </auth-constraint>
</security-constraint>

2) 将所有内容移动到 /protected 文件夹中

3) 将 Android 相关的内容放在其他地方... 可以是 / 或一个新的文件夹 /android


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接