diff --git a/OneDrivePhotoBrowser/AccountSelection.xaml.cs b/OneDrivePhotoBrowser/AccountSelection.xaml.cs index 41306e9..ee98a6c 100644 --- a/OneDrivePhotoBrowser/AccountSelection.xaml.cs +++ b/OneDrivePhotoBrowser/AccountSelection.xaml.cs @@ -47,12 +47,12 @@ private enum ClientType } // Set these values to your app's ID and return URL. - private readonly string oneDriveForBusinessClientId = "Insert your OneDrive for Business client id"; + private readonly string oneDriveForBusinessClientId = ""; private readonly string oneDriveForBusinessReturnUrl = "http://localhost:8080"; private readonly string oneDriveForBusinessBaseUrl = "https://graph.microsoft.com/"; - private readonly string oneDriveConsumerClientId = "Insert your OneDrive Consumer client id"; - private readonly string oneDriveConsumerReturnUrl = "https://login.live.com/oauth20_desktop.srf"; + private readonly string oneDriveConsumerClientId = ""; + private readonly string oneDriveConsumerReturnUrl = ""; private readonly string oneDriveConsumerBaseUrl = "https://api.onedrive.com/v1.0"; private readonly string[] scopes = new string[] { "onedrive.readonly", "wl.signin", "offline_access" }; diff --git a/readme.md b/README.md similarity index 84% rename from readme.md rename to README.md index eae7430..8a1c79b 100644 --- a/readme.md +++ b/README.md @@ -11,6 +11,7 @@ To run the sample, you will need: * Visual Studio 2013 or 2015, with Universal Windows App Development Tools **Note:** If you don't have Universal Windows App Development Tools installed, open **Control Panel** | **Uninstall a program**. Then right-click **Microsoft Visual Studio** and click **Change**. Select **Modify** and then choose **Universal Windows App Development Tools**. Click **Update**. For more info about setting up your machine for Universal Windows Platform development, see [Build UWP apps with Visual Studio](https://msdn.microsoft.com/en-us/library/windows/apps/dn609832.aspx). * A Microsoft account and/or Azure Active Directory account with access to OneDrive for Business +* [Register your app for OneDrive authentication](https://dev.onedrive.com/app-registration.htm#register-your-app-for-onedrive) * Knowledge of Windows Universal app development ### Download the sample @@ -22,7 +23,12 @@ To run the sample, you will need: ### Associate the sample app with the Windows Store -Before you can run the sample to use with OneDrive Consumer, you must associate the app with the Windows Store. To do this, right-click the OneDrivePhotoBrowser project and choose **Store** | **Associate app with store**. Associating the app with the Windows store is reqiured for authentication to succeed. +* Before you can run the sample to use with OneDrive Consumer, you must associate the app with the Windows Store. To do this, right-click the OneDrivePhotoBrowser project and choose **Store** | **Associate app with store**. Associating the app with the Windows store is reqiured for authentication to succeed. +* Get the **App ID** and **Redirect URI** for your app and replace the values in *AccountSelection.xaml.cs* file for the following lines: +```csharp + private readonly string oneDriveConsumerClientId = ""; + private readonly string oneDriveConsumerReturnUrl = ""; +``` OneDrive for Business authentication does not require store association. @@ -33,8 +39,8 @@ In order to authenticate using OneDrive for Business you'll need to enter your a Replace the following values at the top of the file with your application details: ```csharp - private readonly string oneDriveForBusinessClientId = "Insert your AAD client ID here"; - private readonly string oneDriveForBusinessReturnUrl = "Insert your AAD return URL here"; + private readonly string oneDriveForBusinessClientId = ""; + private readonly string oneDriveForBusinessReturnUrl = ""; ``` For more details on setting up an application to access OneDrive for Business please read the [registration documentation](https://dev.onedrive.com/app-registration.htm#register-your-app-for-onedrive-for-business) for the API.