Getting the authentication middleware working