fixes/improvements for login, authentication and examples