Storage and retrieval of credentials in the local storage