gpt4 book ai didi

javascript - OneDrive FilePicker "The provided value for the input parameter ' redirect_uri' 无效”

转载 作者:行者123 更新时间:2023-11-29 10:12:50 25 4
gpt4 key购买 nike

我花了很多时间搜索并试图找到解决方案,但到目前为止没有成功。

我正在尝试根据 https://dev.onedrive.com/sdk/javascript-picker-saver.htm#opening-files-on-onedrive 实现一个简单的 OneDrive 文件选择器

但是我总是报错

https://login.live.com/err.srf?lc=1033#error=invalid_request&error_description=The+provided+value+for+the+input+parameter+'redirect_uri'+is+not+valid.+The+expected+value+is+'https://login.live.com/oauth20_desktop.srf'+or+a+URL+which+matches+the+redirect+URI+registered+for+this+client+application.&state=redirect_type%3dauth%26display%3dpage%26request_ts%3d1430410948914%26response_method%3durl%26secure_cookie%3dfalse

我最初在本地主机上尝试过不同的选项,但即使我将页面加载到一个简单的域上,我也会收到相同的消息。

我已经尝试了各种重定向 url - 似乎都不起作用。

我的网页:

<html>
<head>
<title>OneDrive</title>
<script type="text/javascript" src="https://js.live.net/v5.0/OneDrive.js" id="onedrive-js"
client-id="00000000xxxxxxxx"></script>
<script type="text/javascript">
function ShowOnedrivePicker() {
var oneDrivePickerOptions = {
success: function (files) {
alert( files[0].link + " name:" + files[0].name);
},
cancel: function () {
// handle when the user cancels picking a file
},
linkType: "webViewLink",
multiSelect: false
}
OneDrive.open(oneDrivePickerOptions);
}
</script>
</head>
<body>
<button onclick="ShowOnedrivePicker()">One Drive Picker</button>
</body>
</html>

我已经注册并拥有客户端 ID,并尝试了 API 设置中重定向 URL 的变体,例如 mydomain.com、www.mydomain.com 和 www.mydomain.com/redirect,但均未成功。

虽然我之前在 Stack Overflow 中找到了很多好的解决方案,但这是我第一次提出问题。谢谢。

最佳答案

我已经解决了,当你在 https://apps.dev.microsoft.com/ 上配置重定向 URI 时您必须将“/signin-microsoft”放在末尾。

示例:http://localhost:9000/signin-microsoft

关于javascript - OneDrive FilePicker "The provided value for the input parameter ' redirect_uri' 无效”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29973283/

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