Callback-driven authentication.

The authentication flow now provides a callback for its
post-authentication tasks.