Automated save and restore of credentials.