Server with working digest authentication and file JSON file writing on succesful authentication