当web程序验证用户名和密码时,会向Shiro中的Realm提供用户名和密码。
作为真正进行认证授权的环节,Realm得到Shiro提供的用户名及密码后,会向ini文件或者数据库的用户表去检索。
写一个XXXRealm类,继承AuthorizingRealm抽象类,实现两个抽象方法
即 protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection); 授权
和 protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException; 验证