最近項(xiàng)目中用到HESSIAN, 基于HTTP協(xié)議的傳輸協(xié)議,很方便, 但是基本沒(méi)有安全驗(yàn)證.
想給加上最基本的安全認(rèn)證, HTTP BASIC AUTH是最簡(jiǎn)單的協(xié)議了.
在RESIN中添加的方法:
resin.conf:
<web-app id="/" root-directory="/home/project/leyicai/">
<authenticator type="com.caucho.server.security.XmlAuthenticator">
<init>
<user>leyicai:password:user</user>
<password-digest>none</password-digest>
</init>
</authenticator>
<login-config auth-method='basic'/>
<security-constraint url-pattern='/remoting/*' role-name='user'/>
</web-app>
直接加在RESIN里,簡(jiǎn)單明了,不需要改程序配置.
還可以配置其它方式, 參見(jiàn) http://www.caucho.com/resin-3.0/security/authentication.xtp#XmlAuthenticator