gpt4 book ai didi

python - 我可以在 OneDrive/Sharepoint 中创建不过期 token 吗?

转载 作者:行者123 更新时间:2023-12-03 05:27:32 24 4
gpt4 key购买 nike

我创建了一个 API OneDrive Microsoft 应用程序来列出 odoo 数据库表中的文件夹和文件。客户希望向最终客户发送 onedrive 链接(此表中的字段)以下载该文件。我按照 Microsoft Code Flow API 要求编写了 python 代码。但是, token 在一小时后就会过期。

我尝试了许多 MS Azure API 权限,例如 File.Read、File.Read.All。我还读到我需要授予应用程序权限,所以我这样做了,但是,现在我需要管理员授予同意。在我接触“不太好”的 IT 部门之前,我想仔细检查一下我是否走在正确的轨道上,或者要求不可能的事情:

  • 我可以设计一个从 OneDrive 或 SharePoint 读取数据的应用,并且让 token 不会过期吗?
  • 如果我让 IT 部门授予管理员同意,我是否可以获得不会过期的 token ?
  • 有人有任何建议或解决方法吗?

我使用的是属于公司的 Microsoft 帐户,因此我不是管理员,也不是家庭帐户。

引用:https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/graph-oauth?view=odsp-graph-online

最佳答案

can I design an app to read from OneDrive or SharePoint and have thetoken not expire?

没有。访问 token 必须有一个到期时间。请参阅access token document .

If I get the IT department to grant Admin consent will I be able toget the none expiring tokens?

没有。管理员同意不会做这样的事情。

does anyone have any suggestions or a work around?

您可以考虑Configurable token lifetimes in the Microsoft identity platform (preview)请注意,只有该租户的管理员才能设置

详细步骤列出here .

请注意注意提示。

enter image description here

这意味着上述链接仅适用于移动和桌面客户端。如果您想管理 Web 浏览器 session 的生命周期,请使用 Conditional Access session lifetime feature .

SharePoint Online blog关于配置空闲 session 超时供您引用。

关于python - 我可以在 OneDrive/Sharepoint 中创建不过期 token 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67644458/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com