OneDrive/图形身份验证是否需要浏览器 [英] Is a browser required for Onedrive/Graph Authentication

查看:171
本文介绍了OneDrive/图形身份验证是否需要浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过OneDrive API文档,用户必须始终使用Web浏览器身份验证"才能访问OneDrive API.这对系统帐户没有帮助.我的解释正确吗?还是有一种方法可以在没有浏览器的情况下实现第一步:

It appears via the OneDrive API documentation that a user must always "authenticate" using a web-browser to access the OneDrive API. This is not helpful for system accounts. Am I interpreting this correctly? Or is there a way to achieve step one without a browser:

第1步.获取授权码

要使用代码流启动登录过程,请使用Web浏览器或Web浏览器控件加载此URL请求.

GET https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id={client_id}&scope={scope}
  &response_type=code&redirect_uri={redirect_uri}

https://dev.onedrive.com/auth/graph_oauth.htm #code-flow

推荐答案

您正在寻找的是仅应用程序集成.有关此过程的详细信息,请参见在没有用户的情况下获取访问权限作品.

What you're looking for is an App-Only integration. See Get access without a user for details on how this process works.

请记住,仅应用程序场景和委派场景之间的范围有所不同.此外,仅应用程序的情况将需要管理员同意,然后才能针对给定的租户进行操作(请参阅 v2端点和管理员同意).

Keep in mind that there are scope differences between app-only and delegated scenarios. Also, app-only scenarios will require Admin Consent before they can operate against a given tenant (see v2 Endpoint and Admin Consent).

这篇关于OneDrive/图形身份验证是否需要浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆