Build function for making tea files with authentification