Implement authentication in chat server.