public SelectiveOneDriveClient() { // TODO: Creating the class should not cause this cascasing side effect of // potential UI to request a token (should probably happen as part of an // actual activity) _graphClient = new GraphServiceClient( "https://graph.microsoft.com/v1.0", new DelegateAuthenticationProvider( async(requestMessage) => { //await MSALHelper.SignOut(); var token = await MSALHelper.AcquireToken(); requestMessage.Headers.Authorization = new AuthenticationHeaderValue("bearer", token); })); }
public void StartSync() { _ = MSALHelper.AcquireToken(); Task.Run(OneDriveSyncTask); }