onedrive-php-sdk | OneDrive SDK for PHP | SDK library
kandi X-RAY | onedrive-php-sdk Summary
kandi X-RAY | onedrive-php-sdk Summary
[StyleCI] The OneDrive SDK for PHP is an open source library that allows [PHP][php] applications to interact programmatically with the [OneDrive REST API][onedrive-rest-api]. It supports operations such as creating, reading, updating, deleting (CRUD) files and folders, as well as moving or copying them to other folders.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Builds the service definition .
- Uploads a file .
- Completes the stream .
- Obtain an access token .
- Get the root drive item .
- Builds the options .
- Serialize the value .
- Inject value .
- Builds the options .
- Inject a value .
onedrive-php-sdk Key Features
onedrive-php-sdk Examples and Code Snippets
Community Discussions
Trending Discussions on onedrive-php-sdk
QUESTION
I tried using the library from krizalys for an implementation to read and write files from OneDrive. It should work for business accounts but would be nice if it could also work for personal accounts.
Since I read that the Live SDK used in krizalys example will be offline soon (as mentioned here), I tried implementing Microsoft Graph instead.
I implemented two ways to get an access token at the moment, one with grant type password
(getAccessToken Method from this sample used) and one with client_credentials
(Like in the krizalys lib). Both seem to work and return an access_token
and refresh_token
, but when I try to make a request I get the message:
"InvalidAuthenticationToken [message] => Access token is empty"
The code for my request:
...ANSWER
Answered 2018-Jul-19 at 15:09You've registered your application in the v2 Endpoint (apps.dev.microsoft.com
) but the sample code you're using is for the v1 Endpoint. These are not interchangeable. Also, password
isn't a valid OAuth Grant for the v2 Endpoint (v2 supports authorization_code
, implicit
, and client_credentials
)
You need to obtain your token from the v2 Endpoint. You might find these articles helpful:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install onedrive-php-sdk
To use the OneDrive SDK for PHP, you require a web application exposing a URL initiating the authorization flow. Typically, this URL, referred to as your web application’s Redirect URI, is a PHP script requesting an authorization token. This token is required whenever your web application interacts with your users' OneDrive contents and may be reused across multiple calls. An example of such a web application is our [functional test suite][functional-test-suite]. You also require a OneDrive application. To register such an application, first [sign in to Microsoft Azure][microsoft-azure-login], then visit [App registrations][app-registration-portal] and add a registration for your application. While registering your application, you need to set its Redirect URI, explained above. We currently only support Web redirect URIs. Once created, your application is assigned an Application (client) ID, referred to as its Client ID. In Certificate & secrets, you also need to add at least one Client secret. Warning: Client Secrets are similar to passwords or private keys by allowing an application to identify as yours: therefore, Client Secrets should be kept private. Once you have a Redirect URI, a Client ID, and a Client Secret, your web application can start using the OneDrive SDK for PHP in three steps.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page