shiro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mu <mubao...@gmail.com>
Subject How to get the host in customized Realm?
Date Fri, 16 Sep 2011 03:23:37 GMT
Hello

I have a class which extends from AuthrizingRealm, like the following

public class UserRealm extends AuthorizingRealm {


    protected AuthenticationInfo
doGetAuthenticationInfo(AuthenticationToken authcToken) throws
AuthenticationException {
      ............

       UsernamePasswordToken token = (UsernamePasswordToken) authcToken;

       if(token.getHost().equals("www.abc.com")) {
          .................

       }
       ...................
    }


    protected AuthorizationInfo
doGetAuthorizationInfo(PrincipalCollection principals) {
        String loginName = (String)
principals.fromRealm(getName()).iterator().next();
        ......
    }

}

I want to get the host name in the doGetAuthorizationInfo method, just
like what to do in the doGetAuthenticationInfo method

What should i do?

Thanks

Mime
View raw message