You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by scSynergy <ro...@scsynergy.de> on 2015/10/26 08:45:23 UTC

Re: Shiro and orientdb (realm config)

You have to write your own realm:
public class MongoRealm extends AuthorizingRealm implements Serializable {

    @Override
    protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection
pc) {
        // retrieve user's roles and permissions from database, then
        SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
        info.setRoles(roles);
        info.setObjectPermissions(permissions);
        return info;
    }

    @Override
    protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken
at) throws AuthenticationException {
       String userName = at.getPrincipal().toString();
       // retrieve user's salt and password from database, then
       return new SimpleAuthenticationInfo(user.getName(),
user.getPassword(), ByteSource.Util.bytes(user.getSalt()),
getClass().getName());
    }



--
View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-and-orientdb-realm-config-tp7580822p7580825.html
Sent from the Shiro User mailing list archive at Nabble.com.