implementation of User authentication