拡張子だけで制約をつけたい。私は以下を使用しようとしています -
<security-constraint>
<display-name>XYZRole</display-name>
<web-resource-collection>
<web-resource-name>XYZRole</web-resource-name>
<url-pattern>*.bear</url-pattern>
<http-method>GET</http-method>
<http-method>PUT</http-method>
<http-method>HEAD</http-method>
<http-method>TRACE</http-method>
<http-method>POST</http-method>
<http-method>DELETE</http-method>
<http-method>OPTIONS</http-method>
</web-resource-collection>
<auth-constraint>
<description>Access to XYZRole</description>
<role-name>XYZRole</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<display-name>Secure Everything</display-name>
<web-resource-collection>
<web-resource-name>All resources</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>PUT</http-method>
<http-method>HEAD</http-method>
<http-method>TRACE</http-method>
<http-method>POST</http-method>
<http-method>DELETE</http-method>
<http-method>OPTIONS</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>AllAuthenticated</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
security.user.names.bear
andはsecurity.user.roles.bear
、プロパティ ファイルで定義されています。ただし、有効なテナントのホワイトリスト登録は行っていません。
拡張 URL パターンの入れ方<security-constraint>