onedrive / onedrive-explorer-js Goto Github PK
View Code? Open in Web Editor NEWOneDrive sample application for JavaScript.
License: MIT License
OneDrive sample application for JavaScript.
License: MIT License
In my webapp I've used the Onedrive JS API, as described here: https://dev.onedrive.com/sdk/js-v7/js-picker-open.htm to allow my users to pick a file (from which the url is then sent to my webapp). For this I've registered an app as described on that same page.
This works fine with my own Onedrive Business account and colleagues on the same (Azure) tenant.
But when a customer of ours tries to use it on their account the OneDrive.js
throws this error: [OneDriveSDK] calling xhr failure callback, status: 401
followed by this reponse:
(the Dutch loosely translates to: "Access Denied. You are not authorised to perform this action or open this resource")
"{
"error": {
"code": "-2147024891, System.UnauthorizedAccessException",
"message": "Toegang geweigerd. U bent niet gemachtigd om deze bewerking uit te voeren of deze bron te openen.",
"innerError": {
"request-id": "81c39bae-5004-4657-b7a5-1e06a35da730",
"date": "2016-07-18T10:25:38"
}
}
}"
Is there something I have to enable on my side to allow the customer to use my app or does the customer have to enable something on their side?
Hi ,
Is it possible to use service account at enterprise level to access the drive contents .
How to get access token with out involving users ?.
Thanks
I've modified the OD_Auth script to use the code authentication flow described here, but am getting a CORS header missing error:
XMLHttpRequest cannot load https://login.live.com/oauth20_token.srf. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
This is my auth callback:
var onAuthCallback = function () {
var auth_code = getAuthInfoFromUrl(),
appInfo = getAppInfo(),
url = 'https://login.live.com/oauth20_token.srf',
params = 'client_id='
+ appInfo.clientId
+ '&redirect_uri='
+ appInfo.redirect_uri
+ '&client_secret='
+ appInfo.clientSecret
+ '&code='
+ auth_code
+ '&grant_type=authorization_code',
method = 'POST',
xhr = createCORSRequest( method, url );
xhr.setRequestHeader( "Access-Control-Allow-Origin", appInfo.base_uri );
xhr.setRequestHeader( "Content-type", "application/x-www-form-urlencoded" );
xhr.onload = function () {
console.log( xhr.responseText );
};
xhr.onerror = function () {
// Error code goes here.
};
xhr.send( params );
};
var createCORSRequest = function ( method, url ) {
var xhr = new XMLHttpRequest();
if ( "withCredentials" in xhr ) {
// Most browsers.
xhr.open( method, url, true );
} else if ( typeof XDomainRequest != "undefined" ) {
// IE8 & IE9
xhr = new XDomainRequest();
xhr.open( method, url );
} else {
// CORS not supported.
xhr = null;
}
return xhr;
};
Am I missing something?
Our company wants to integrate One Drive for business in our application. Our goal is using OneDrive filepicker to download files from One Drive business account to our server. Form the One Drive for business App documentation, for filepicker, the return url must be the same domain as the request page. Our scenario is our server hosts a lot of customers and each customer has their own domains. We try to find a solution which multiple domains filepicker can share the same return url. Is it possible?
OneDrive API returns a default page size limit of 200 items.
How can I increase this limit?
Top-parameter in odquery like:
var odquery = "?top=500&expand=thumbnails,children(expand=thumbnails(select=" + thumbnailSize + "))";
doesn't work.
Hello!
In order to implement a filepicker with onedrive, I cross this github project which seems to be perfect for me. The link "See it in action!" in the readme of this project seems to no longer work. Is this behaviour expected?
It leads to https://developer.microsoft.com/en-us/onedrive instead, I beleive, to something else (eg: a real example of the filepicker)
hello,
the sample code is nice, but currently GET requests require either following a redirect or doing an ajax GET to the "@content.downloadUrl" url, both of which fail with CORS error.
Any way to actually download files using the ondrive API? Seems pretty incomplete without that
Hi there!
I'm testing out integrating the OneDrive JS File Picker SDK v7.2
with our web app. Unfortunately, if I import it directly, it apparently overwrites Promise
and breaks functionality that we have written in already. Do you have any suggestions around this or have plans to fix it? Thanks!
Is there anything in the works to allow guests to use this explorer without sign in (via a guest link)?
I cannot imagine that this is the approved way to authenticate. Is it possible that this sample is out of date and there is a more modern and simple API for authenticating to OneDrive?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.