0

AppEngine に GWT アプリケーションをデプロイしています。アプリケーションへのアクセスを管理者のみに制限したいと考えています。

web.xml で組み込みの security-constraint 設定を使用したいのですが、/myapp ではなく /myapp/admin url でアプリを応答させる方法がわかりません。サーバーとの通信に RequestFactory を使用しています。 /gwtRequest が同じ制約の下にあることを望みます。

ありがとう、イド。

4

1 に答える 1

1

私はあなたの質問を正しく理解しているかどうかわかりません。

adminのみでアクセスする場合は、次のようにアプリケーションを構成できます。

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

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

これで、すべてのページへの管理者アクセスのみが可能になりましたが、ログインページへのパブリックアクセスが必要です。(「loginpage」をログインページのURLに置き換える必要があります)

admin-accessでgwtRequestのみを作成する場合は、次のようにします。

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

/gwtRequest/なのか/gwtRequestなのかわからないのでごめんなさい

于 2012-05-05T09:38:29.557 に答える