base on source code of  cas-server-3.5.2