1

If yes, then how?

I have files on my own OneDr2ive account. I am writing an application that will at times upload and/or download very tiny files to it. The program only runs via Task Scheduler, and should do so with no user interaction.

I have gone down the LiveSDK and OneDrive SDK routes with no joy, trying to get a simple example of fully logging on with Client ID & Secret, with no success.

At this point I am in need of knowing whether what I am trying to do is even possible. I have a similar, but more detailed, question here about OAuth2, which is concerned with the same use case.

TIA

Community
  • 1
  • 1
Yumi Koizumi
  • 331
  • 2
  • 4
  • 12

2 Answers2

0

Yes - after the initial authorization.

If the first run of the application there is prompt for username/password and the consent flow validation with the offline_access scope then further authentication attempts will not require user interaction.

Peter Nied
  • 1,820
  • 1
  • 13
  • 22
-1

The primary way of accessing OneDrive as well as SharePoint online is through powershell. Create the process in powershell first. Then once it is working startup powershell from the C# service and use the calls done in the previous step.

Community
  • 1
  • 1
ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
  • I may have done this wrong, but the new API required me to authenticate via a form. Have you tried this approach with the new API? You (?) put a **TON** of work into it, either way. I would love to see the example migrated for OneDrive! – Yumi Koizumi Jul 07 '16 at 15:07
  • @YumiKoizumi I have worked on SharePoint online where we authenticate all in powershell calls. I haven't tried an operation on OneDrive yet, but I believe the concept should be scriptable without popping up a authentication form. – ΩmegaMan Jul 07 '16 at 15:11