简体   繁体   中英

C# Winforms Authenticate with Microsoft Onedrive

Is is possible to login to Microsoft's OneDrive API without having to use a Browser-based OAuth mechanism?

I have a server application in C# that I would like to connect to a OneDrive account and manage files. Every code sample and piece of information I find always requires a browser-based authentication process. Is there way to utilize the Application secure keys or password to bypass this nuisance?

-Jeff

Yes, you can do that with application identity (no user login is needed).

Here are the steps that you have to do in your Azure portal:

  1. Register Application in azure portal
  2. Add required scopes like Files.ReadWrite.All etc..
  3. Generate secrete Key for Identity

Or here is a Shortcut provided by MS Docs, where you can create Client Id and Secret with a single click.

在此处输入图片说明

Use Client ID , Tenant Id , Secret Key to authenticate any calls without user login.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM