開発メモ

開発用のメモです。

Tomcat / 認証構造

<?xml version="1.0" encoding="UTF-8"?>
<web-app
    id="WebApp_ID"
    version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>
<!-- 省略 -->
    <security-constraint>
        <display-name>auth</display-name>
        <web-resource-collection>
            <web-resource-name>auth</web-resource-name>
            <description></description>
            <url-pattern>/*</url-pattern>
            <http-method>GET</http-method>
            <http-method>POST</http-method>
            <http-method>HEAD</http-method>
        </web-resource-collection>
        <auth-constraint>
            <description>auth</description>
            <role-name>*</role-name>
        </auth-constraint>
    </security-constraint>
    <login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>DataSourceRealm</realm-name>
    </login-config>
    <security-role>
        <role-name>*</role-name>
    </security-role>
<!-- 省略 -->
</web-app>
Twitter: @asahina_alice