简体   繁体   English

当我的重定向网址包含唯一用户ID时,如何使用OneDrive网络选择器?

[英]How can I use the OneDrive Web picker when my redirect URLs include unique user ids?

I am trying to add the OneDrive Web picker SDK (Javascript) to my website. 我正在尝试将OneDrive Web选择器SDK(Javascript)添加到我的网站。 There is a "redirect URL" that must be added for each page on which the picker is located. 必须为选择器所在的每个页面添加“重定向URL”。 The problem I'm having is that my URL is, eg, www.mysite.com/user/382982389745 . 我遇到的问题是我的网址是,例如www.mysite.com/user/382982389745 Now, I can't reasonably be expected to add a redirect URL for each user in my database. 现在,我无法合理地期望为我的数据库中的每个用户添加重定向URL。 So, how can I handle this issue since the redirect URL must match exactly to the page that has the file picker? 那么,我如何处理这个问题,因为重定向URL必须与具有文件选择器的页面完全匹配?

Hi am facing the same Problem, After spending few hours I am able to fix this problem. 您好我面临同样的问题,花了几个小时后,我能够解决这个问题。

Please follow the steps. 请按照步骤操作。

Step 1) Go to the Link Download the File Js file and save it https://js.live.net/v6.0/OneDrive.js 步骤1)转到链接下载文件Js文件并保存它https://js.live.net/v6.0/OneDrive.js

Step 2) Unminfiy the js file using any of the online tool 步骤2)使用任何在线工具取消发送js文件

Step 3) Replace Line 2265 with -- if (!a) a = rf(document.location.origin); 步骤3)用 - 如果(!a)a = rf(document.location.origin)替换2265行;

Step 4) Save Js File and use in your Project 步骤4)保存Js文件并在您的项目中使用

Step 5) In API set the Redirect URL as Base URL of the Application 步骤5)在API中将重定向URL设置为应用程序的基本URL

or -- http://example.com 或 - http://example.com

Here we go.. It will fix you probem. 我们走了..它会解决你的问题。 It work on all page of the same Base URL. 它适用于同一基本URL的所有页面。

If you still have any query write to me - shobhitwalia@gmail.com 如果您还有任何疑问,请写信给我 - shobhitwalia@gmail.com

I have dealt with a similar problem. 我处理过类似的问题。 My solution was to add the Id as a parameter which seemed to work. 我的解决方案是将Id添加为似乎有用的参数。

In your case change the url to www.mysite.com/user?id=382982389745 and then the redirect url to www.mysite.com/user 在您的情况下,将网址更改为www.mysite.com/user?id=382982389745,然后将重定向网址更改为www.mysite.com/user

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM