SharePoint Online UserInfo 终结点 URL

SharePoint Online UserInfo endpoint URL

我正在尝试使用 Microsoft.SharePointOnline.CSOM 版本 16.1.7018.1200

构建 SharePoint Online 适配器

我正在努力为这个 REST API 寻找正确的端点 URL。其中一些可能与 GDrive 中的相同(因为它们都使用 OAuth2),但我仍然有点困惑。我的问题是: - 范围、LoginBaseUrl、AccessTokenBaseUrl 和 UserInfoEndpointUrl

以 GDrive 为例:

Scope = "https://www.googleapis.com/auth/drive.file";

LoginBaseUrl = "https://accounts.google.com/o/oauth2/auth";
AdditionalLoginParameters.Add("response_type", "code");

AccessTokenBaseUrl = "https://accounts.google.com/o/oauth2/token";
AdditionalAccessTokenParameters.Add("grant_type", "authorization_code");

UserInfoEndpointUrl = "https://www.googleapis.com/drive/v3/about?fields=user&access_token=" + accessToken;

PS:如果有人有一些文档或代码示例,将不胜感激!到目前为止,我只能找到读取操作的代码示例。

如果需要任何其他信息,请告诉我。

此致, SVG

如果您从身份验证的角度谈论用户信息端点,Azure Active Directory 实际上正在处理 SharePoint 在线的大部分身份验证和一些授权。事情目前有点复杂:

  • AAD v1 终结点(用于希望通过 Microsoft Graph 与更广泛的 Office 365 堆栈对话的应用程序)
  • AADv2 端点(也用于需要与消费者工作负载通信的应用程序)
  • SharePoint 的应用程序授权服务(用于只能与 SharePoint 通信而不能与 Office 365 堆栈中的其他服务通信的应用程序)

但是 v2 配置端点将提供 user_info 端点 documentation

如果您想在此处阅读 SharePoint 用户配置文件 the documentation REST API,CSOM 为您提供了更多功能。

但是,如果您没有映射到专门从 SharePoint 读取的需求,我建议改为使用 Graph 用户端点Documentation