Missing functions for authentication (chapter 8)