please make method PersistCredentials asyc to avoid UI from hanging here.