This project provides a sample UWP (Universal Windows Platform) implementation of a files explorer for Microsoft OneDrive with a Personal or Work/School account.
This sample illustrates how to use OneDrive APIs through Microsoft.Identity.Client and Microsoft.Graph NuGet packages in order to authenticate the user and browse her/his files.
Solution | Author(s) |
---|---|
uwp-files-explorer | Paolo Pialorsi (MCM, MVP, PiaSys.com, @PaoloPia) |
Version | Date | Comments |
---|---|---|
1.0.0 | November 12, 2018 | Initial release |
THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
The sample application implements the following features:
- Authentication and authorization access to OneDrive
- Files and folders browsing
- Download and upload files
To get started with the sample, you need to complete the following actions:
- Register a new application into Microsoft Application Registration Portal.
- Configure the project with your Client id.
- Run the sample project and sign-in account and accept the consent prompt.
- Navigate to user me drive, download or upload a file.
- Sign into the App Registration Portal using either your personal or work or school account.
- Select Add an app.
- Enter a name for the app, and select Create application. The registration page displays, listing the properties of your app.
- Under Platforms, select Add platform.
- Select Native Application.
- Copy the Client Id (App Id) value to the clipboard.
- Select Save.
- Open the the solution and then open the App.xaml file: paste the Client Id into the String resource.
<Application.Resources>
<x:String x:Key="ClientId">paste client id here</x:String>
</Application.Resources>
- Run the sample pressing F5.
For more information about Microsoft Authentication Library, check out the library project.
For more information about Microsoft Graph API, see Microsoft Graph.
See License for the license agreement covering this sample code.