Tomcat sso 二
本文记录tomcat本身对sso的支持,接上文Tomcat sso 一,以下为FORM验证配置,1,2步骤不变,区别在于第3步骤
3
<welcome-file-list>
<welcome-file>/web1/t1.jsp</welcome-file> </welcome-file-list>
<security-constraint>
<web-resource-collection>
<web-resource-name>test</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>tomcat</role-name>
<role-name>role1</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/index.jsp</form-login-page>
<form-error-page>/errorm.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>tomcat</role-name>
<role-name>role1</role-name>
</security-role>
4 增加了登录页面
<form method="POST" action="j_security_check"> <table border="0"><tr>
<td>Enter the username: </td><td>
<input type="text" name="j_username" size="15">
</td>
</tr>
<tr>
<td>Enter the password: </td><td>
<input type="password" name="j_password" size="15">
</td>
</tr>
<tr>
<td> <input type="submit" value="Submit"> </td>
</tr>
</table>
</form>