add support for custom authentication callbacks

Refs #10