Actually this could be pretty easy, assuming I'm not forgetting anything:

1.  In your filter, add a request attribute, e.g.
request.setAttribute("useShiroSession", Boolean.FALSE));

2.  In your overridden 'bind' implementation, check for that attribute:

ServletRequest request = org.apache.shiro.web.util.WebUtils.getRequest(subject);
//request will be null in a non-web request scenario, so we need to
//check for null:
if (request != null) {
    Boolean attr = (Boolean)request.getAttribute("useShiroSession");
    boolean useSession = attr != null ? attr.booleanValue() : true;
    if (useSession) {
       super.bind(subject);
    } else {
       return;
    }
}

I HTH.  If not, let me know and we'll figure it out.

Cheers,

-- 
Les Hazlewood
CTO, Katasoft | http://www.katasoft.com | 888.391.5282
twitter: http://twitter.com/lhazlewood
katasoft blog: http://www.katasoft.com/blogs/lhazlewood
personal blog: http://leshazlewood.com

Reply via email to