Improve authentication manager interface and fix some issues with async ipc.