implemented authentication and authorization on server and client