How about moving this to the separate anonymous callback, to avoid copy-paste?

Also, I believe guardian doesn't set correct credentials here, and this will be a problem. The code above, which you copied, uses AccessGuard for that.
(If it's not clear why daemon sets credentials and guardian sometimes doesn't, see #27, that should somewhat explain it.)