Add tests and documentation for using authentication