tomcat-users.xml
<tomcat-users>
<role rolename="aaaa" />
<user username="bbb" password="ccc" roles="aaaa" />
</tomcat-users>
web.xml
<web-app>
<security-constraint>
<web-resource-collection>
<web-resource-name>
Authentication of BasicAuth
</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>basic</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>ProtectedRealm</realm-name>
</login-config>
</web-app>
参考リンク
http://www.javaroad.jp/opensource/js_tomcat9.htm
http://www.coderanch.com/t/465990/java-Web-Component-SCWCD/certification/HTTP-Status-Access-requested-resource
0 件のコメント:
コメントを投稿