sharepoint - 使用 CSOM 和 grant_type=client_credentials 访问 sharepoint\office 365
问题描述
我已按照此示例中的说明进行操作: https ://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/using-csom-for-dotnet-standard 并且可以正常连接:-) 使用grant_type=密码,用户名和密码
但是我想使用客户端 ID 和客户端密码进行连接...... 我已经在 AzureAD 中设置了这些
我想知道是否有人有这个工作的例子?
我也尝试过这个https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs 并且我可以让它工作,根据文档这已经在 11 月退休2018 年 7 月 7 日。
我不确定它使用什么身份验证方法或如何识别身份验证方法。
解决方案
If this registration is only used for SharePoint, you do not need to expose an API.
You don't need scope. You will need to pass in the 'client_id' and 'resource' like below and it will look something similar to this for getting a token to make a call to SharePoint:
client_id: [appRegistrationClientId]@[tenantid]
Resource: 00000003-0000-0ff1-ce00-000000000000/[tenant].sharepoint.com@[tenant-id]
This will help too: https://anexinet.com/blog/getting-an-access-token-for-sharepoint-online/
推荐阅读
- c# - 类实例数组特定方法
- microsoft-partnercenter-java - 使用 CVP 租户访问多个 CSP
- orientdb - 在服务器端函数中将字符串转换为 ORecordId
- html - 在 Jquery 制作的 Snake 游戏中计算分数
- python - sympy 是否有内置方法来设置多个多项式彼此相等?
- scala - 为什么在推断类型构造函数时不使用所有类型边界?
- linux - 为 Linux 内核构建完整的控制流图
- google-sheets - 雅虎财经获得增长率
- javascript - 如何在不丢失编译时类型安全的情况下将 [一些嵌套输入对象] 转换为 [Generic 1] 到 [Generic 2]?
- node.js - 使用 firebase 托管的网页仅返回内部服务器错误