updated sample to persist oauth credentials