ページの先頭行へ戻る
Interstage Application Server/Interstage Web Server J2EE ユーザーズガイド

7.5.13 アクセス制限

アクセス制限の定義は、security-constraintタグで定義します。

記述形式

    <security-constraint>
      <web-resource-collection>
        <web-resource-name>resource-name</web-resource-name>
        <url-pattern>pattern</url-pattern>
        <http-method>method</http-method>
      </web-resource-collection>
      <auth-constraint>
        <role-name>name</role-name>
      </auth-constraint>
      <user-data-constraint>
        <transport-guarantee>guarantee-type</transport-guarantee>
      </user-data-constraint>
    </security-constraint>

タグの内容

タグ名

説明

タグの省略

複数の指定

web-resource-collection

Webリソースコレクションを定義します。

×

web-resource-name

webリソースのコレクション名を定義します。
web-resource-collectionタグの定義時は、必須です。

×

×

url-pattern

URLパターンを定義します。
Webアプリケーションのルートディレクトリからの対象パスで定義します。このとき、先頭に“/”を追加します。

×

http-method

HTTPのメソッド(GET、POSTなど)を定義します。
定義したメソッドに対してだけアクセスが制限されます。
省略した場合は、全メソッドがアクセス制限の対象となります。

auth-constraint

Webリソースコレクションにアクセス可能なセキュリティロールを定義します。
指定したロールを持つユーザだけ、リソースコレクションにアクセス可能となります。
省略した場合は、すべてのユーザがアクセス可能となります。

×

role-name

セキュリティロール名を定義します。
セキュリティロール名が指定された場合、ユーザの識別が必要となるため、ユーザ認証が行われます。
role-nameタグまたは値を省略した場合は、どのユーザもアクセスできません。

user-data-constraint

データ保護属性を定義します。クライアント-コンテナ間で通信するデータをどう保護すべきであるかを定義します。

×

transport-guarantee

クライアント-サーバ間の転送方法を定義します。
user-data-constraintタグの定義時は、必須です。
以下の値を指定します。

  • NONE
    アプリケーションが、転送保証を必要としないことを意味します。

  • INTEGRAL
    クライアント-サーバ間で送信されるデータの転送保証を必要とすることを意味します。

  • CONFIDENTIAL
    データの盗聴の防止が必要であることを意味します。

INTEGRALまたはCONFIDENTIALを指定された場合は、SSLによる通信であることを保証します。

×

×

記述例

    <security-constraint>
      <web-resource-collection>
        <web-resource-name>Hello</web-resource-name>
        <url-pattern>/Hello.jsp</url-pattern>
        <http-method>GET</http-method>
      </web-resource-collection>
      <auth-constraint>
        <role-name>Administrator</role-name>
      </auth-constraint>
      <user-data-constraint>
        <transport-guarantee>NONE</transport-guarantee>
      </user-data-constraint>
    </security-constraint>