save credentials to file