此 api 版本不支持 onedrive 文件选择器 aadsts70001 应用程序

onedrive file picker aadsts70001 application is not supported for this api version

尝试使用 onedrive for business 文件选择器打开文件时,我总是遇到相同的错误:

此 api 版本不支持 aadsts70001 应用程序

我在 azure 中为应用程序设置了所有设置:clientId、redirectUri (http://localhost:2009) 以及在线共享点和图形的所有权限 api)。我还更改了清单设置 oauth2AllowImplicitFlow = true.

我使用的是微软的这个例子。我刚刚更改为我的 clientId:

https://github.com/rgregg/onedrive-filepicker-javascript

没有办法让它工作!

OneDrive 文件选择器JavaScript SDK v7.0 使用的是 App Model 2.0。

v2.0 Protocols - OAuth 2.0 & OpenID Connect

在 Azure AD 上注册的应用不支持此应用模型。

要使用 OneDrive 选择器,您需要通过 Microsoft Application Registration Portal 注册您的应用程序并接收客户端 ID。

弹出登录对话框时,使用您的 Azure AD 帐户登录。

然后您就可以使用这个 JavaScript 文件选取器来访问 OneDrive for Business。